diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2022-05-23 17:54:32 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-23 18:19:51 +0000 |
commit | 71f9c400074406c2439dc654677de4dcc2612a82 (patch) | |
tree | ec6856b8fe50534a3786e83ce36b96c1f910eee8 | |
parent | fb115177b008ca06797095504c26568d1a9a4cea (diff) | |
download | mongo-71f9c400074406c2439dc654677de4dcc2612a82.tar.gz |
SERVER-66618 Wait in test for resharding coordinator to persist abort.r6.0.0-rc7
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.js | 12 |
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, |