summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2022-06-07 19:54:18 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-06-07 20:28:11 +0000
commit32762963363d127ae187965b8ab59eea8603f5dd (patch)
tree8b83a1a3f669ef9dc43ecc00c0e0081f7fa081e4
parentde31372c6f05c52083a28d10c12ff2ffa2d42655 (diff)
downloadmongo-32762963363d127ae187965b8ab59eea8603f5dd.tar.gz
SERVER-66618 Wait in test for resharding coordinator to persist abort.
Fixes an issue in the resharding_coordinator_recovers_abort_decision.js test where the reshardingPauseCoordinatorBeforeBlockingWrites failpoint is being released too early and allowing the resharding coordinator to decide to commit the resharding operation instead. (cherry picked from commit 18ec8376222bd7afe8485441af2c3aba3130ea2e)
-rw-r--r--jstests/sharding/resharding_coordinator_recovers_abort_decision.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/jstests/sharding/resharding_coordinator_recovers_abort_decision.js b/jstests/sharding/resharding_coordinator_recovers_abort_decision.js
index c06474cd527..80e0ef14b77 100644
--- a/jstests/sharding/resharding_coordinator_recovers_abort_decision.js
+++ b/jstests/sharding/resharding_coordinator_recovers_abort_decision.js
@@ -48,9 +48,19 @@ reshardingTest.withReshardingInBackground(
// Wait until participants are aware of the resharding operation.
reshardingTest.awaitCloneTimestampChosen();
+ const ns = sourceCollection.getFullName();
awaitAbort = startParallelShell(funWithArgs(function(ns) {
db.adminCommand({abortReshardCollection: ns});
- }, sourceCollection.getFullName()), mongos.port);
+ }, ns), mongos.port);
+
+ // Wait for the coordinator to have persisted its decision to abort the resharding operation
+ // as a result of the abortReshardCollection command being processed.
+ assert.soon(() => {
+ const coordinatorDoc =
+ mongos.getCollection("config.reshardingOperations").findOne({ns: ns});
+
+ return coordinatorDoc !== null && coordinatorDoc.state === "aborting";
+ });
},
{
expectedErrorCode: ErrorCodes.ReshardCollectionAborted,