From 2b204e8aaed867988cf7f54bee2ce84e31f4c955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Jos=C3=A9=20Grillo=20Ramirez?= Date: Mon, 22 Nov 2021 11:59:41 +0000 Subject: SERVER-56227 Add user-facing command for permitMigrations using DDL coordinator --- jstests/sharding/move_chunk_allowMigrations.js | 35 -------------------------- 1 file changed, 35 deletions(-) (limited to 'jstests/sharding/move_chunk_allowMigrations.js') diff --git a/jstests/sharding/move_chunk_allowMigrations.js b/jstests/sharding/move_chunk_allowMigrations.js index 4db3d97b946..1ef488f7f33 100644 --- a/jstests/sharding/move_chunk_allowMigrations.js +++ b/jstests/sharding/move_chunk_allowMigrations.js @@ -62,38 +62,6 @@ const setUpDb = function setUpDatabaseAndEnableSharding() { assert.eq(false, cachedEntry.allowMigrations); })(); -// TODO SERVER-61033: remove after permitMigrations have been merged with allowMigrations. -// Tests that moveChunk does not succeed when {permitMigrations: false} -(function testPermitMigrationsFalsePreventsMoveChunk() { - setUpDb(); - - const collName = "collA"; - const ns = dbName + "." + collName; - - assert.commandWorked(st.s.getDB(dbName).getCollection(collName).insert({_id: 0})); - assert.commandWorked(st.s.getDB(dbName).getCollection(collName).insert({_id: 1})); - assert.commandWorked(st.s.adminCommand({shardCollection: ns, key: {_id: 1}})); - - // Confirm that an inProgress moveChunk fails once {allowMigrations: false} - const fp = configureFailPoint(st.shard0, "moveChunkHangAtStep4"); - const awaitResult = startParallelShell( - funWithArgs(function(ns, toShardName) { - assert.commandFailedWithCode( - db.adminCommand({moveChunk: ns, find: {_id: 0}, to: toShardName}), - ErrorCodes.ConflictingOperationInProgress); - }, ns, st.shard1.shardName), st.s.port); - fp.wait(); - assert.commandWorked(configDB.collections.updateOne( - {_id: ns}, {$set: {permitMigrations: false}}, {writeConcern: {w: "majority"}})); - fp.off(); - awaitResult(); - - // {permitMigrations: false} is set, sending a new moveChunk command should also fail. - assert.commandFailedWithCode( - st.s.adminCommand({moveChunk: ns, find: {_id: 0}, to: st.shard1.shardName}), - ErrorCodes.ConflictingOperationInProgress); -})(); - // Tests {allowMigrations: false} disables balancing for collB and does not interfere with balancing // for collA. // @@ -238,9 +206,6 @@ testBalancer(false /* allowMigrations */, {}); testBalancer(false /* allowMigrations */, {noBalance: false}); testBalancer(false /* allowMigrations */, {noBalance: true}); -// TODO SERVER-61033: merge permitMigrations with allowMigrations. -testBalancer(true /* allowMigrations */, {permitMigrations: false}); - // Test the _configsvrSetAllowMigrations internal command testConfigsvrSetAllowMigrationsCommand(); -- cgit v1.2.1