diff options
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..f91c5d88cc7 --- /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, /*isDowngrade*/ false); +})(); |