summaryrefslogtreecommitdiff
path: root/jstests/sharding/nonreplicated_uuids_on_shardservers.js
blob: 75389fd1e54f40cd5e7f26848191c57fae6e9ae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SERVER-32255 This test ensures a node started with --shardsvr and added to a replica set receives
// UUIDs upon re-initiation.
// @tags: [multiversion_incompatible]
(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.
const clusterRoleOption = TestData.configShard ? "configsvr" : "shardsvr";
let newNode = rs.add({[clusterRoleOption]: '', 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();
})();