diff options
Diffstat (limited to 'jstests/sharding/uuid_propagated_to_recipient_shard_on_recvChunkStart.js')
-rw-r--r-- | jstests/sharding/uuid_propagated_to_recipient_shard_on_recvChunkStart.js | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/jstests/sharding/uuid_propagated_to_recipient_shard_on_recvChunkStart.js b/jstests/sharding/uuid_propagated_to_recipient_shard_on_recvChunkStart.js index 94ac86dbb97..e5dde50d8bb 100644 --- a/jstests/sharding/uuid_propagated_to_recipient_shard_on_recvChunkStart.js +++ b/jstests/sharding/uuid_propagated_to_recipient_shard_on_recvChunkStart.js @@ -3,44 +3,43 @@ * collection on itself as part of a migration. */ (function() { - "use strict"; +"use strict"; - load("jstests/libs/uuid_util.js"); +load("jstests/libs/uuid_util.js"); - let db = "test"; - let coll = "foo"; - let nss = db + "." + coll; +let db = "test"; +let coll = "foo"; +let nss = db + "." + coll; - let st = new ShardingTest({shards: {rs0: {nodes: 1}, rs1: {nodes: 1}}, other: {config: 3}}); +let st = new ShardingTest({shards: {rs0: {nodes: 1}, rs1: {nodes: 1}}, other: {config: 3}}); - let donor = st.shard0; - let recipient = st.shard1; +let donor = st.shard0; +let recipient = st.shard1; - let setUp = function() { - assert.commandWorked(st.s.adminCommand({enableSharding: db})); - st.ensurePrimaryShard(db, donor.shardName); - assert.commandWorked(st.s.adminCommand({shardCollection: nss, key: {_id: 1}})); - }; +let setUp = function() { + assert.commandWorked(st.s.adminCommand({enableSharding: db})); + st.ensurePrimaryShard(db, donor.shardName); + assert.commandWorked(st.s.adminCommand({shardCollection: nss, key: {_id: 1}})); +}; - // Check that the recipient accepts the chunk and uses the UUID from the recipient when creating - // the collection. +// Check that the recipient accepts the chunk and uses the UUID from the recipient when creating +// the collection. - setUp(); - assert.commandWorked( - st.s.adminCommand({moveChunk: nss, find: {_id: 0}, to: recipient.shardName})); +setUp(); +assert.commandWorked(st.s.adminCommand({moveChunk: nss, find: {_id: 0}, to: recipient.shardName})); - let donorUUID = getUUIDFromListCollections(donor.getDB(db), coll); - assert.neq(undefined, donorUUID); +let donorUUID = getUUIDFromListCollections(donor.getDB(db), coll); +assert.neq(undefined, donorUUID); - let recipientUUID = getUUIDFromListCollections(recipient.getDB(db), coll); - assert.neq(undefined, recipientUUID); +let recipientUUID = getUUIDFromListCollections(recipient.getDB(db), coll); +assert.neq(undefined, recipientUUID); - assert.eq(donorUUID, recipientUUID); +assert.eq(donorUUID, recipientUUID); - // Sanity check that the UUID in config.collections matches the donor's and recipient's UUIDs. - let collEntryUUID = getUUIDFromConfigCollections(st.s, nss); - assert.neq(undefined, collEntryUUID); - assert.eq(donorUUID, collEntryUUID); +// Sanity check that the UUID in config.collections matches the donor's and recipient's UUIDs. +let collEntryUUID = getUUIDFromConfigCollections(st.s, nss); +assert.neq(undefined, collEntryUUID); +assert.eq(donorUUID, collEntryUUID); - st.stop(); +st.stop(); })(); |