summaryrefslogtreecommitdiff
path: root/jstests/sharding/resharding_prohibited_commands.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/resharding_prohibited_commands.js')
-rw-r--r--jstests/sharding/resharding_prohibited_commands.js19
1 files changed, 3 insertions, 16 deletions
diff --git a/jstests/sharding/resharding_prohibited_commands.js b/jstests/sharding/resharding_prohibited_commands.js
index 9f7d73b57c3..d06a9561d2a 100644
--- a/jstests/sharding/resharding_prohibited_commands.js
+++ b/jstests/sharding/resharding_prohibited_commands.js
@@ -118,7 +118,6 @@ const waitUntilReshardingInitializedOnDonor = () => {
* @param {Function} config.setup
* @param {AfterReshardingCallback} afterReshardingFn
*/
-
const withReshardingInBackground =
(duringReshardingFn,
{setup = () => {}, expectedErrorCode, afterReshardingFn = () => {}} = {}) => {
@@ -133,34 +132,22 @@ const withReshardingInBackground =
},
duringReshardingFn,
{expectedErrorCode: expectedErrorCode, afterReshardingFn: afterReshardingFn});
+
assertCommandsSucceedAfterReshardingOpFinishes(mongos.getDB(databaseName));
assert.commandWorked(sourceCollection.dropIndex(indexCreatedByTest));
};
// Tests that the prohibited commands work if the resharding operation is aborted.
-let awaitAbort;
withReshardingInBackground(() => {
waitUntilReshardingInitializedOnDonor();
- assert.neq(null,
- mongos.getCollection("config.reshardingOperations").findOne({ns: sourceNamespace}));
- awaitAbort = startParallelShell(funWithArgs(function(sourceNamespace) {
- db.adminCommand({abortReshardCollection: sourceNamespace});
- }, sourceNamespace), mongos.port);
- // Wait for the coordinator to remove coordinator document from config.reshardingOperations
- // as a result of the recipients and donors transitioning to done due to abort.
- assert.soon(() => {
- const coordinatorDoc =
- mongos.getCollection("config.reshardingOperations").findOne({ns: sourceNamespace});
- return coordinatorDoc === null || coordinatorDoc.state === "aborting";
- });
+ assert.commandWorked(mongos.adminCommand({abortReshardCollection: sourceNamespace}));
}, {
expectedErrorCode: ErrorCodes.ReshardCollectionAborted,
});
-awaitAbort();
// Tests that the prohibited commands succeed if the resharding operation succeeds. During the
-// operation it makes sure that the prohibited commands are rejected during the resharding
+// operation it makes sures that the prohibited commands are rejected during the resharding
// operation.
withReshardingInBackground(() => {
waitUntilReshardingInitializedOnDonor();