summaryrefslogtreecommitdiff
path: root/jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js
diff options
context:
space:
mode:
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.js50
1 files changed, 25 insertions, 25 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 fb610a68925..2d6b4c57020 100644
--- a/jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js
+++ b/jstests/sharding/uuid_propagated_to_config_server_on_shardCollection.js
@@ -3,39 +3,39 @@
* persists it in config.collections.
*/
(function() {
- "use strict";
+"use strict";
- load("jstests/libs/uuid_util.js");
+load("jstests/libs/uuid_util.js");
- let db = "test";
+let db = "test";
- 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}});
- assert.commandWorked(st.s.adminCommand({enableSharding: db}));
- st.ensurePrimaryShard(db, st.shard0.shardName);
+assert.commandWorked(st.s.adminCommand({enableSharding: db}));
+st.ensurePrimaryShard(db, st.shard0.shardName);
- // Check that shardCollection propagates and persists UUIDs.
- for (let i = 0; i < 3; i++) {
- let coll = "bar" + i;
- let nss = db + "." + coll;
+// Check that shardCollection propagates and persists UUIDs.
+for (let i = 0; i < 3; i++) {
+ let coll = "bar" + 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}));
- }
+ // 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}}));
+ assert.commandWorked(st.s.adminCommand({shardCollection: nss, key: {_id: 1}}));
- // Check that the entry for the collection in config.collections has a uuid field.
- let collEntryUUID = getUUIDFromConfigCollections(st.s, nss);
- assert.neq(undefined, collEntryUUID);
+ // Check that the entry for the collection in config.collections has a uuid field.
+ let collEntryUUID = getUUIDFromConfigCollections(st.s, nss);
+ assert.neq(undefined, collEntryUUID);
- // Check that the uuid field in the config.collections entry matches the uuid on the shard.
- let listCollsUUID = getUUIDFromListCollections(st.shard0.getDB(db), coll);
- assert.neq(undefined, listCollsUUID);
- assert.eq(listCollsUUID, collEntryUUID);
- }
+ // Check that the uuid field in the config.collections entry matches the uuid on the shard.
+ let listCollsUUID = getUUIDFromListCollections(st.shard0.getDB(db), coll);
+ assert.neq(undefined, listCollsUUID);
+ assert.eq(listCollsUUID, collEntryUUID);
+}
- st.stop();
+st.stop();
})();