diff options
Diffstat (limited to 'jstests/sharding/clone_catalog_data.js')
| -rw-r--r-- | jstests/sharding/clone_catalog_data.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/jstests/sharding/clone_catalog_data.js b/jstests/sharding/clone_catalog_data.js index bd0651b0e78..62596057477 100644 --- a/jstests/sharding/clone_catalog_data.js +++ b/jstests/sharding/clone_catalog_data.js @@ -106,18 +106,14 @@ checkOptions(c2, Object.keys(coll2Options)); checkUUID(c2, coll2uuid); - function checkIndexes(collName, expectedIndexes, shardedColl) { + function checkIndexes(collName, expectedIndexes) { var res = toShard.getDB('test').runCommand({listIndexes: collName}); assert.commandWorked(res, 'Failed to get indexes for collection ' + collName); var indexes = res.cursor.firstBatch; indexes.sort(sortByName); - // TODO SERVER-74252: once 7.0 becomes LastLTS we can assume that the movePrimary will never - // copy indexes of sharded collections. - if (shardedColl) - assert(indexes.length === 1 || indexes.length === 3); - else - assert(indexes.length === 3); + // There should be 3 indexes on each collection - the _id one, and the 2 we created. + assert.eq(indexes.length, 3); indexes.forEach((index, i) => { var expected; @@ -131,8 +127,8 @@ }); } - checkIndexes('coll1', coll1Indexes, /*shardedColl*/ false); - checkIndexes('coll2', coll2Indexes, /*shardedColl*/ true); + checkIndexes('coll1', coll1Indexes); + checkIndexes('coll2', coll2Indexes); // Verify that the data from the unsharded collections resides on the new primary shard, and was // copied as part of the clone. |
