summaryrefslogtreecommitdiff
path: root/jstests/sharding/refine_collection_shard_key_basic.js
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2019-09-09 16:01:18 +0000
committerevergreen <evergreen@mongodb.com>2019-09-09 16:01:18 +0000
commit0eb3337d580b7a9f486ee6157be0bc68e6ef4a38 (patch)
tree0c5597f753580adcc7d588321e3a7bea96bcdc11 /jstests/sharding/refine_collection_shard_key_basic.js
parent20761c26375cd0febaade9d93af5b8848845bef9 (diff)
downloadmongo-0eb3337d580b7a9f486ee6157be0bc68e6ef4a38.tar.gz
SERVER-43201 Allow refine_collection_shard_key_basic.js to have more than one config.changelogs entry after completion of refine command, to account for stepdowns
Diffstat (limited to 'jstests/sharding/refine_collection_shard_key_basic.js')
-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})