diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2021-05-12 22:36:21 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-12 23:00:16 +0000 |
commit | b2d663d4846e7aaeb0f76632e623182e1d6d22af (patch) | |
tree | e449c1500e955b4bcfee6be05b08f42ada84ee92 | |
parent | 23f47ea6089f8ca022beaa24063c849b23cd180b (diff) | |
download | mongo-b2d663d4846e7aaeb0f76632e623182e1d6d22af.tar.gz |
SERVER-52461 Enable resharding feature flag by default.
14 files changed, 51 insertions, 27 deletions
diff --git a/buildscripts/resmokeconfig/fully_disabled_feature_flags.yml b/buildscripts/resmokeconfig/fully_disabled_feature_flags.yml index cccec5f9af3..11886676f99 100644 --- a/buildscripts/resmokeconfig/fully_disabled_feature_flags.yml +++ b/buildscripts/resmokeconfig/fully_disabled_feature_flags.yml @@ -5,4 +5,3 @@ - featureFlagFryer - featureFlagSBE -- featureFlagResharding diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js index 5ea3d7e5200..a83c7dfcdd1 100644 --- a/jstests/auth/lib/commands_lib.js +++ b/jstests/auth/lib/commands_lib.js @@ -2620,6 +2620,35 @@ var authCommandsLib = { ] }, { + testname: "commitReshardCollection", + command: {commitReshardCollection: "test.x"}, + skipUnlessSharded: true, + testcases: [ + { + runOnDb: adminDbName, + roles: Object.extend({enableSharding: 1}, roles_clusterManager), + privileges: + [{resource: {db: "test", collection: "x"}, actions: ["reshardCollection"]}], + expectFail: true + }, + ] + }, + { + testname: "_configsvrCommitReshardCollection", + command: {_configsvrCommitReshardCollection: "test.x"}, + skipSharded: true, + testcases: [ + { + runOnDb: adminDbName, + roles: {__system: 1}, + privileges: [{resource: {cluster: true}, actions: ["internal"]}], + expectFail: true + }, + {runOnDb: firstDbName, roles: {}}, + {runOnDb: secondDbName, roles: {}} + ] + }, + { testname: "commitTxn", command: {commitTransaction: 1}, // TODO (SERVER-53497): Enable auth testing for abortTransaction and commitTransaction. diff --git a/jstests/replsets/db_reads_while_recovering_all_commands.js b/jstests/replsets/db_reads_while_recovering_all_commands.js index 67313fd8690..3b02283aadc 100644 --- a/jstests/replsets/db_reads_while_recovering_all_commands.js +++ b/jstests/replsets/db_reads_while_recovering_all_commands.js @@ -112,6 +112,7 @@ const allCommands = { expectFailure: true, expectedErrorCode: ErrorCodes.NotPrimaryOrSecondary, }, + commitReshardCollection: {skip: isPrimaryOnly}, commitTransaction: {skip: isPrimaryOnly}, compact: {skip: isNotAUserDataRead}, configureFailPoint: {skip: isNotAUserDataRead}, diff --git a/jstests/sharding/database_versioning_all_commands.js b/jstests/sharding/database_versioning_all_commands.js index 25dc807ac00..b95be6a9da3 100644 --- a/jstests/sharding/database_versioning_all_commands.js +++ b/jstests/sharding/database_versioning_all_commands.js @@ -286,6 +286,7 @@ let testCases = { }, } }, + commitReshardCollection: {skip: "always targets the config server"}, commitTransaction: {skip: "unversioned and uses special targetting rules"}, compact: {skip: "not allowed through mongos"}, configureFailPoint: {skip: "executes locally on mongos (not sent to any remote node)"}, diff --git a/jstests/sharding/libs/resharding_test_fixture.js b/jstests/sharding/libs/resharding_test_fixture.js index dcf0e0f2454..7c0682d5206 100644 --- a/jstests/sharding/libs/resharding_test_fixture.js +++ b/jstests/sharding/libs/resharding_test_fixture.js @@ -88,35 +88,36 @@ var ReshardingTest = class { } setup() { - let config = {setParameter: {featureFlagResharding: true}}; + const mongosOptions = {setParameter: {}}; + const configOptions = {setParameter: {}}; + const rsOptions = {setParameter: {}}; if (this._minimumOperationDurationMS !== undefined) { - config.setParameter.reshardingMinimumOperationDurationMillis = + configOptions.setParameter.reshardingMinimumOperationDurationMillis = this._minimumOperationDurationMS; } if (this._criticalSectionTimeoutMS !== -1) { - config.setParameter.reshardingCriticalSectionTimeoutMillis = + configOptions.setParameter.reshardingCriticalSectionTimeoutMillis = this._criticalSectionTimeoutMS; } - let rsConfig = {setParameter: {featureFlagResharding: true}}; if (this._periodicNoopIntervalSecs !== undefined) { - rsConfig.setParameter.periodicNoopIntervalSecs = this._periodicNoopIntervalSecs; + rsOptions.setParameter.periodicNoopIntervalSecs = this._periodicNoopIntervalSecs; } if (this._writePeriodicNoops !== undefined) { - rsConfig.setParameter.writePeriodicNoops = this._writePeriodicNoops; + rsOptions.setParameter.writePeriodicNoops = this._writePeriodicNoops; } this._st = new ShardingTest({ mongos: 1, - mongosOptions: {setParameter: {featureFlagResharding: true}}, + mongosOptions, config: 1, - configOptions: config, + configOptions, shards: this._numShards, rs: {nodes: 2}, - rsOptions: rsConfig, + rsOptions, manualAddShard: true, }); diff --git a/jstests/sharding/read_write_concern_defaults_application.js b/jstests/sharding/read_write_concern_defaults_application.js index dada4c5e107..d5e2af4d8d5 100644 --- a/jstests/sharding/read_write_concern_defaults_application.js +++ b/jstests/sharding/read_write_concern_defaults_application.js @@ -214,6 +214,7 @@ let testCases = { checkWriteConcern: true, }, collStats: {skip: "does not accept read or write concern"}, + commitReshardCollection: {skip: "does not accept read or write concern"}, commitTransaction: { setUp: function(conn) { assert.commandWorked(conn.getDB(db).runCommand({create: coll, writeConcern: {w: 1}})); diff --git a/jstests/sharding/reshard_collection_basic.js b/jstests/sharding/reshard_collection_basic.js index 30d41e9013e..f65afce09fe 100644 --- a/jstests/sharding/reshard_collection_basic.js +++ b/jstests/sharding/reshard_collection_basic.js @@ -13,13 +13,7 @@ load("jstests/sharding/libs/find_chunks_util.js"); (function() { 'use strict'; -const st = new ShardingTest({ - mongos: 1, - mongosOptions: {setParameter: {featureFlagResharding: true}}, - configOptions: {setParameter: {featureFlagResharding: true}}, - shards: 2, - shardOptions: {setParameter: {featureFlagResharding: true}}, -}); +const st = new ShardingTest({mongos: 1, shards: 2}); const kDbName = 'db'; const collName = 'foo'; const ns = kDbName + '.' + collName; diff --git a/jstests/sharding/resharding_disallow_drop.js b/jstests/sharding/resharding_disallow_drop.js index 4adc56341b4..7d943e46c89 100644 --- a/jstests/sharding/resharding_disallow_drop.js +++ b/jstests/sharding/resharding_disallow_drop.js @@ -25,13 +25,7 @@ var st = new ShardingTest({ config: 1, mongos: 1, other: { - mongosOptions: {setParameter: {featureFlagResharding: true}}, - configOptions: { - setParameter: { - featureFlagResharding: true, - reshardingCriticalSectionTimeoutMillis: 24 * 60 * 60 * 1000 - } - } + configOptions: {setParameter: {reshardingCriticalSectionTimeoutMillis: 24 * 60 * 60 * 1000}} } }); diff --git a/jstests/sharding/safe_secondary_reads_drop_recreate.js b/jstests/sharding/safe_secondary_reads_drop_recreate.js index bc9e51c5915..e2faeb20fad 100644 --- a/jstests/sharding/safe_secondary_reads_drop_recreate.js +++ b/jstests/sharding/safe_secondary_reads_drop_recreate.js @@ -107,6 +107,7 @@ let testCases = { cloneCollectionAsCapped: {skip: "primary only"}, collMod: {skip: "primary only"}, collStats: {skip: "does not return user data"}, + commitReshardCollection: {skip: "primary only"}, commitTransaction: {skip: "primary only"}, compact: {skip: "does not return user data"}, configureFailPoint: {skip: "does not return user data"}, diff --git a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js index 681cccf6f2e..c00cda30940 100644 --- a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js +++ b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js @@ -123,6 +123,7 @@ let testCases = { clearLog: {skip: "does not return user data"}, clone: {skip: "primary only"}, cloneCollectionAsCapped: {skip: "primary only"}, + commitReshardCollection: {skip: "primary only"}, commitTransaction: {skip: "primary only"}, collMod: {skip: "primary only"}, collStats: {skip: "does not return user data"}, diff --git a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js index ecc29df4870..c2151fc332f 100644 --- a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js +++ b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js @@ -111,6 +111,7 @@ let testCases = { cloneCollectionAsCapped: {skip: "primary only"}, collMod: {skip: "primary only"}, collStats: {skip: "does not return user data"}, + commitReshardCollection: {skip: "primary only"}, commitTransaction: {skip: "primary only"}, compact: {skip: "does not return user data"}, configureFailPoint: {skip: "does not return user data"}, diff --git a/src/mongo/s/commands/cluster_commit_reshard_collection_cmd.cpp b/src/mongo/s/commands/cluster_commit_reshard_collection_cmd.cpp index 3affa06b45c..b23f2eb3604 100644 --- a/src/mongo/s/commands/cluster_commit_reshard_collection_cmd.cpp +++ b/src/mongo/s/commands/cluster_commit_reshard_collection_cmd.cpp @@ -76,7 +76,7 @@ public: } bool supportsWriteConcern() const override { - return true; + return false; } void doCheckAuthorization(OperationContext* opCtx) const override { diff --git a/src/mongo/s/commands/cluster_reshard_collection_cmd.cpp b/src/mongo/s/commands/cluster_reshard_collection_cmd.cpp index bf5740916af..17c0e36eec1 100644 --- a/src/mongo/s/commands/cluster_reshard_collection_cmd.cpp +++ b/src/mongo/s/commands/cluster_reshard_collection_cmd.cpp @@ -86,7 +86,7 @@ public: } bool supportsWriteConcern() const override { - return true; + return false; } void doCheckAuthorization(OperationContext* opCtx) const override { diff --git a/src/mongo/s/resharding/resharding_feature_flag.idl b/src/mongo/s/resharding/resharding_feature_flag.idl index 53df50502d6..e83de02e286 100644 --- a/src/mongo/s/resharding/resharding_feature_flag.idl +++ b/src/mongo/s/resharding/resharding_feature_flag.idl @@ -38,4 +38,5 @@ feature_flags: featureFlagResharding: description: When enabled, allows users to reshard their sharded collections. cpp_varname: gFeatureFlagResharding - default: false + default: true + version: 5.0 |