SERVER-66997 Remove NoChangeStreamEventsDueToOrphans feature flag
This commit is contained in:
committed by
Evergreen Agent
parent
8402a8253b
commit
a554bc4f5f
@@ -8,9 +8,7 @@
|
||||
* @tags: [
|
||||
* requires_sharding,
|
||||
* assumes_balancer_off,
|
||||
* uses_change_streams,
|
||||
* requires_fcv_53,
|
||||
* featureFlagNoChangeStreamEventsDueToOrphans
|
||||
* uses_change_streams
|
||||
* ];
|
||||
*/
|
||||
load('jstests/concurrency/fsm_libs/extend_workload.js');
|
||||
|
||||
@@ -7,11 +7,6 @@
|
||||
* - Test case 2: Broadcasted operations (from router) on orphaned documents
|
||||
* - Test case 3: Transaction from router updating both orphaned and owned documents
|
||||
* - Test case 4: Transaction to shard updating both orphaned and owned documents
|
||||
*
|
||||
* @tags: [
|
||||
* requires_fcv_53,
|
||||
* featureFlagNoChangeStreamEventsDueToOrphans,
|
||||
* ]
|
||||
*/
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
@@ -43,18 +43,8 @@ assert.eq(1, res.nModified, res);
|
||||
|
||||
// Do a multi=true update that will target both shards but not update any documents on the shard
|
||||
// which owns the range [-1, MaxKey].
|
||||
const clusterParams = st.configRS.getPrimary().adminCommand(
|
||||
{getParameter: 1, featureFlagNoChangeStreamEventsDueToOrphans: 1});
|
||||
if (!clusterParams.hasOwnProperty("featureFlagNoChangeStreamEventsDueToOrphans") ||
|
||||
!clusterParams.featureFlagNoChangeStreamEventsDueToOrphans.value) {
|
||||
res = assert.commandFailedWithCode(
|
||||
collection.update(
|
||||
{x: {$lte: 0}, y: {$exists: false}}, {$set: {x: -10, y: 2}}, {multi: true}),
|
||||
31025);
|
||||
} else {
|
||||
res = assert.commandWorked(collection.update(
|
||||
{x: {$lte: 0}, y: {$exists: false}}, {$set: {x: -10, y: 2}}, {multi: true}));
|
||||
}
|
||||
res = assert.commandWorked(
|
||||
collection.update({x: {$lte: 0}, y: {$exists: false}}, {$set: {x: -10, y: 2}}, {multi: true}));
|
||||
assert.eq(0, res.nMatched, res);
|
||||
assert.eq(0, res.nModified, res);
|
||||
assert.eq(0, res.nUpserted, res);
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "mongo/db/query/plan_executor_impl.h"
|
||||
#include "mongo/db/service_context.h"
|
||||
#include "mongo/logv2/log.h"
|
||||
#include "mongo/s/pm2423_feature_flags_gen.h"
|
||||
#include "mongo/util/scopeguard.h"
|
||||
|
||||
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kWrite
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "mongo/db/s/collection_sharding_state.h"
|
||||
#include "mongo/db/s/operation_sharding_state.h"
|
||||
#include "mongo/logv2/redaction.h"
|
||||
#include "mongo/s/pm2423_feature_flags_gen.h"
|
||||
|
||||
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kWrite
|
||||
|
||||
@@ -49,14 +48,7 @@ namespace mongo {
|
||||
namespace write_stage_common {
|
||||
|
||||
PreWriteFilter::PreWriteFilter(OperationContext* opCtx, NamespaceString nss)
|
||||
: _opCtx(opCtx),
|
||||
_nss(std::move(nss)),
|
||||
_isEnabled([] {
|
||||
auto& fcv = serverGlobalParams.featureCompatibility;
|
||||
return fcv.isVersionInitialized() &&
|
||||
feature_flags::gFeatureFlagNoChangeStreamEventsDueToOrphans.isEnabled(fcv);
|
||||
}()),
|
||||
_skipFiltering([&] {
|
||||
: _opCtx(opCtx), _nss(std::move(nss)), _skipFiltering([&] {
|
||||
// Always allow writes on replica sets.
|
||||
if (serverGlobalParams.clusterRole == ClusterRole::None) {
|
||||
return true;
|
||||
@@ -68,10 +60,6 @@ PreWriteFilter::PreWriteFilter(OperationContext* opCtx, NamespaceString nss)
|
||||
}()) {}
|
||||
|
||||
PreWriteFilter::Action PreWriteFilter::computeAction(const Document& doc) {
|
||||
// Skip the checks if the Filter is not enabled.
|
||||
if (!_isEnabled)
|
||||
return Action::kWrite;
|
||||
|
||||
if (_skipFiltering) {
|
||||
// Secondaries do not apply any filtering logic as the primary already did.
|
||||
return Action::kWrite;
|
||||
|
||||
@@ -79,7 +79,6 @@ private:
|
||||
|
||||
OperationContext* _opCtx;
|
||||
NamespaceString _nss;
|
||||
const bool _isEnabled;
|
||||
const bool _skipFiltering;
|
||||
std::unique_ptr<ShardFilterer> _shardFilterer;
|
||||
};
|
||||
|
||||
@@ -77,7 +77,6 @@
|
||||
#include "mongo/s/client/shard_registry.h"
|
||||
#include "mongo/s/cluster_commands_helpers.h"
|
||||
#include "mongo/s/grid.h"
|
||||
#include "mongo/s/pm2423_feature_flags_gen.h"
|
||||
#include "mongo/s/shard_key_pattern.h"
|
||||
#include "mongo/s/sharding_feature_flags_gen.h"
|
||||
#include "mongo/stdx/chrono.h"
|
||||
|
||||
@@ -171,7 +171,6 @@ env.Library(
|
||||
'database_version.cpp',
|
||||
'database_version.idl',
|
||||
'mongod_and_mongos_server_parameters.idl',
|
||||
'pm2423_feature_flags.idl',
|
||||
'request_types/abort_reshard_collection.idl',
|
||||
'request_types/add_shard_request_type.cpp',
|
||||
'request_types/get_stats_for_balancing.idl',
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
# Copyright (C) 2021-present MongoDB, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the Server Side Public License, version 1,
|
||||
# as published by MongoDB, Inc.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# Server Side Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the Server Side Public License
|
||||
# along with this program. If not, see
|
||||
# <http://www.mongodb.com/licensing/server-side-public-license>.
|
||||
#
|
||||
# As a special exception, the copyright holders give permission to link the
|
||||
# code of portions of this program with the OpenSSL library under certain
|
||||
# conditions as described in each individual source file and distribute
|
||||
# linked combinations including the program with the OpenSSL library. You
|
||||
# must comply with the Server Side Public License in all respects for
|
||||
# all of the code used other than as permitted herein. If you modify file(s)
|
||||
# with this exception, you may extend this exception to your version of the
|
||||
# file(s), but you are not obligated to do so. If you do not wish to do so,
|
||||
# delete this exception statement from your version. If you delete this
|
||||
# exception statement from all source files in the program, then also delete
|
||||
# it in the license file.
|
||||
#
|
||||
|
||||
# Feature flag for PM-2423
|
||||
|
||||
global:
|
||||
cpp_namespace: "mongo::feature_flags"
|
||||
|
||||
imports:
|
||||
- "mongo/idl/basic_types.idl"
|
||||
|
||||
feature_flags:
|
||||
featureFlagNoChangeStreamEventsDueToOrphans:
|
||||
description: Feature flag for preventing the generation of change stream events due to
|
||||
writes on orphan documents.
|
||||
cpp_varname: gFeatureFlagNoChangeStreamEventsDueToOrphans
|
||||
default: true
|
||||
version: 5.3
|
||||
Reference in New Issue
Block a user