summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/sharding/refine_collection_shard_key_basic.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/jstests/sharding/refine_collection_shard_key_basic.js b/jstests/sharding/refine_collection_shard_key_basic.js
index a698649a3be..2cbc4790edd 100644
--- a/jstests/sharding/refine_collection_shard_key_basic.js
+++ b/jstests/sharding/refine_collection_shard_key_basic.js
@@ -55,10 +55,12 @@ function validateConfigCollections(keyDoc, oldEpoch) {
}
function validateConfigChangelog(count) {
- assert.eq(count,
- mongos.getCollection(kConfigChangelog)
- .find({what: 'refineCollectionShardKey.start', ns: kNsName})
- .itcount());
+ // We allow for more than one entry in the changelog for the 'start' message, because a config
+ // server stepdown can cause the command to be retried and the changelog entry to be rewritten.
+ assert.gte(count,
+ mongos.getCollection(kConfigChangelog)
+ .find({what: 'refineCollectionShardKey.start', ns: kNsName})
+ .itcount());
assert.eq(count,
mongos.getCollection(kConfigChangelog)
.find({what: 'refineCollectionShardKey.end', ns: kNsName})