diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-01-17 14:24:27 -0500 |
---|---|---|
committer | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-01-19 17:50:24 -0500 |
commit | 9ed0b147b5cb71b8fbc7d28f43d66aa623b08ac1 (patch) | |
tree | 6ce5ab60d6dc869eb7e6d31c4f230285a822c212 /jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js | |
parent | 194ec4857fa0db8085da88e22eaae96687902d66 (diff) | |
download | mongo-9ed0b147b5cb71b8fbc7d28f43d66aa623b08ac1.tar.gz |
SERVER-32463 Remove / modify FCV dependent sharding UUID tests
Diffstat (limited to 'jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js')
-rw-r--r-- | jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js b/jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js index d8dffb2f455..fb610a68925 100644 --- a/jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js +++ b/jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js @@ -1,13 +1,11 @@ /** - * 1) Tests that in fcv=3.4, the shardCollection command does not persist a UUID in - * config.collections. - * - * 2) Tests that in fcv=3.6, the shardCollection command obtains the collection's UUID from the - * primary shard and persists it in config.collections. + * Tests that the shardCollection command obtains the collection's UUID from the primary shard and + * persists it in config.collections. */ (function() { + "use strict"; - load('jstests/libs/uuid_util.js'); + load("jstests/libs/uuid_util.js"); let db = "test"; @@ -16,29 +14,8 @@ assert.commandWorked(st.s.adminCommand({enableSharding: db})); st.ensurePrimaryShard(db, st.shard0.shardName); - // Check that in fcv=3.4, shardCollection does not persist a UUID. - assert.commandWorked(st.s.adminCommand({setFeatureCompatibilityVersion: "3.4"})); + // Check that shardCollection propagates and persists UUIDs. for (let i = 0; i < 3; i++) { - let coll = "foo" + i; - let nss = db + "." + coll; - - // It shouldn't matter whether the collection existed on the shard already or not; test - // both cases. - if (i === 0) { - assert.writeOK(st.s.getDB(db).getCollection(coll).insert({x: 1})); - } - - assert.commandWorked(st.s.adminCommand({shardCollection: nss, key: {_id: 1}})); - - // Check that the entry in config.collections does not have a uuid field. - assert.eq(undefined, getUUIDFromConfigCollections(st.s, nss)); - } - - // Check that in fcv=3.6, shardCollection propagates and persists UUIDs. - assert.commandWorked(st.s.adminCommand({setFeatureCompatibilityVersion: "3.6"})); - for (let i = 0; i < 3; i++) { - // Use different collection names because the ones starting with 'foo' are already sharded - // and will have a UUID generated for them on setFCV=3.6. let coll = "bar" + i; let nss = db + "." + coll; @@ -60,4 +37,5 @@ assert.eq(listCollsUUID, collEntryUUID); } + st.stop(); })(); |