diff options
author | Maria van Keulen <maria@mongodb.com> | 2018-01-03 16:49:38 -0500 |
---|---|---|
committer | Maria van Keulen <maria@mongodb.com> | 2018-01-04 18:24:08 -0500 |
commit | 2158ea8d6c84c9a68b50f76c9dd23b8a193b65f8 (patch) | |
tree | 54609407fa0eb6b0df0a5684682c725159e06068 /jstests/sharding | |
parent | 3a2b878f747a3a2bc2a49347162872303cf4a19f (diff) | |
download | mongo-2158ea8d6c84c9a68b50f76c9dd23b8a193b65f8.tar.gz |
SERVER-32255 Ensure UUIDs exist for local collections on ShardServers
Diffstat (limited to 'jstests/sharding')
-rw-r--r-- | jstests/sharding/nonreplicated_uuids_on_shardservers.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/sharding/nonreplicated_uuids_on_shardservers.js b/jstests/sharding/nonreplicated_uuids_on_shardservers.js new file mode 100644 index 00000000000..ab3f878189f --- /dev/null +++ b/jstests/sharding/nonreplicated_uuids_on_shardservers.js @@ -0,0 +1,22 @@ +// SERVER-32255 This test ensures a node started with --shardsvr and added to a replica set receives +// UUIDs upon re-initiation. +(function() { + "use strict"; + load("jstests/libs/check_uuids.js"); + let st = new ShardingTest({shards: 1, rs: {nodes: 1}, mongos: 1}); + let mongos = st.s; + let rs = st.rs0; + + // Create `test.coll`. + mongos.getDB("test").coll.insert({_id: 1, x: 1}); + + // Add a node with --shardsvr to the replica set. + let newNode = rs.add({'shardsvr': '', rsConfig: {priority: 0, votes: 0}}); + rs.reInitiate(); + rs.awaitSecondaryNodes(); + + let secondaryAdminDB = newNode.getDB("admin"); + + // Ensure the new node has UUIDs for all its collections. + checkCollectionUUIDs(secondaryAdminDB); +})(); |