diff options
author | Blake Oler <blake.oler@mongodb.com> | 2019-09-09 16:01:18 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-09 16:01:18 +0000 |
commit | 0eb3337d580b7a9f486ee6157be0bc68e6ef4a38 (patch) | |
tree | 0c5597f753580adcc7d588321e3a7bea96bcdc11 | |
parent | 20761c26375cd0febaade9d93af5b8848845bef9 (diff) | |
download | mongo-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
-rw-r--r-- | jstests/sharding/refine_collection_shard_key_basic.js | 10 |
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}) |