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 | 46 |
1 files changed, 7 insertions, 39 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 72bb2633a72..94ac86dbb97 100644 --- a/jstests/sharding/uuid_propagated_to_recipient_shard_on_recvChunkStart.js +++ b/jstests/sharding/uuid_propagated_to_recipient_shard_on_recvChunkStart.js @@ -1,16 +1,11 @@ /** - * 1. Tests that if the donor and recipient shards are in fcv=3.4, the recipient shard accepts the - * chunk even though the donor does not return a UUID as part of listCollections. - * - * 2. Tests that a recipient shard in fcv=3.6 expects listCollections against the donor shard - * primary to return a UUID, and fails if it does not (i.e., the donor shard primary has fcv < 3.6). - * - * 3. Tests that if the donor and recipient shards are in fcv=3.6, the recipient shard uses the UUID - * obtained from the donor shard when creating the collection on itself. + * Tests that the recipient shard uses the UUID obtained from the donor shard when creating the + * collection on itself as part of a migration. */ (function() { + "use strict"; - load('jstests/libs/uuid_util.js'); + load("jstests/libs/uuid_util.js"); let db = "test"; let coll = "foo"; @@ -27,37 +22,9 @@ assert.commandWorked(st.s.adminCommand({shardCollection: nss, key: {_id: 1}})); }; - // 1. Check that if both the donor and recipient are in fcv=3.4, the recipient accepts the - // chunk even though the donor does not return a UUID. + // Check that the recipient accepts the chunk and uses the UUID from the recipient when creating + // the collection. - assert.commandWorked(st.s.adminCommand({setFeatureCompatibilityVersion: "3.4"})); - setUp(); - assert.commandWorked( - st.s.adminCommand({moveChunk: nss, find: {_id: 0}, to: recipient.shardName})); - - assert.commandWorked(st.s.getDB(db).runCommand({dropDatabase: 1})); - - // 2. Check that if the donor is in fcv=3.4, but the recipient is in fcv=3.6, the recipient - // fails to accept the chunk. - - assert.commandWorked(recipient.adminCommand({setFeatureCompatibilityVersion: "3.6"})); - setUp(); - assert.commandFailed( - st.s.adminCommand({moveChunk: nss, find: {_id: 0}, to: recipient.shardName})); - - // Sanity check that the recipient shard did not create the collection on itself. - let listCollsRes = recipient.getDB(db).runCommand({listCollections: 1, filter: {name: coll}}); - assert.commandWorked(listCollsRes); - assert.neq(undefined, listCollsRes.cursor); - assert.neq(undefined, listCollsRes.cursor.firstBatch); - assert.eq(0, listCollsRes.cursor.firstBatch.length); - - assert.commandWorked(st.s.getDB(db).runCommand({dropDatabase: 1})); - - // 3. Check that if both the donor and recipient are in fcv=3.6, the recipient accepts the chunk - // and uses the UUID from the recipient when creating the collection. - - assert.commandWorked(st.s.adminCommand({setFeatureCompatibilityVersion: "3.6"})); setUp(); assert.commandWorked( st.s.adminCommand({moveChunk: nss, find: {_id: 0}, to: recipient.shardName})); @@ -75,4 +42,5 @@ assert.neq(undefined, collEntryUUID); assert.eq(donorUUID, collEntryUUID); + st.stop(); })(); |