summaryrefslogtreecommitdiff
path: root/jstests/sharding/nonreplicated_uuids_on_shardservers.js
blob: 7c7be172ee116699b07ad35ae8029825b60e2829 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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);
    st.stop();
})();