summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2021-11-20 00:05:47 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-11-20 00:29:27 +0000
commit30741fdf18baf6e75c16ad8b52d6d77c090c173f (patch)
tree597f140f5aebb53f83daa8c2df4cfde8f9929aaf
parentbc125b9010c623aed2c3da49b4cbd809a4c3a865 (diff)
downloadmongo-30741fdf18baf6e75c16ad8b52d6d77c090c173f.tar.gz
SERVER-61607 Add DuplicateKey as acceptable error in resharding test.
(cherry picked from commit 57877f14e139e08d60558f3e70f320e33b7d4079)
-rw-r--r--jstests/sharding/resharding_nonblocking_coordinator_rebuild.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/jstests/sharding/resharding_nonblocking_coordinator_rebuild.js b/jstests/sharding/resharding_nonblocking_coordinator_rebuild.js
index 2ee6c76aaf1..dac1afc0014 100644
--- a/jstests/sharding/resharding_nonblocking_coordinator_rebuild.js
+++ b/jstests/sharding/resharding_nonblocking_coordinator_rebuild.js
@@ -109,7 +109,19 @@ reshardingTest.withReshardingInBackground(
}
},
{
- expectedErrorCode: 5356800,
+ // As a result of the elections intentionally triggered on the config server replica sets,
+ // the primary shard of the database may retry the _configsvrReshardCollection command. It
+ // is possible for the resharding operation from the first _configsvrReshardCollection
+ // command to have entirely finished executing to the point of removing the coordinator
+ // state document. A retry of the _configsvrReshardCollection command in this situation will
+ // lead to a second resharding operation to run. The second resharding operation will have
+ // the duplicate documents cloned by the ReshardingCollectionCloner rather than applied by
+ // the ReshardingOplogApplier as intended. This results in the reshardCollection command
+ // failing with a DuplicateKey error rather than the error code for the stash collections
+ // being non-empty. The recipient must have been able to successfully update its state to
+ // "applying" in the first resharding operation even when the ReshardingCoordinatorService
+ // had yet to be rebuilt so we accept DuplicateKey as an error too.
+ expectedErrorCode: [5356800, ErrorCodes.DuplicateKey],
});
reshardingTest.teardown();