summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2022-06-21 07:13:51 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-06-21 07:43:34 +0000
commit4287c364fabb19336ed191ea88f72e7521999ffc (patch)
tree1cdf7ccc7318e1c5a497f7fff31a6416cd391c03
parentcf7a66cd4f524cb973df4784d3ebbcebbe06b750 (diff)
downloadmongo-4287c364fabb19336ed191ea88f72e7521999ffc.tar.gz
Revert "SERVER-66347 Extend add/remove shards tests to verify that the topologyTime is properly gossiped"
This reverts commit 46d25203fcbe843eec1b2432e1d4ed1e9d598164.
-rw-r--r--jstests/sharding/topology_changes_bump_topology_time.js64
1 files changed, 0 insertions, 64 deletions
diff --git a/jstests/sharding/topology_changes_bump_topology_time.js b/jstests/sharding/topology_changes_bump_topology_time.js
deleted file mode 100644
index 7820f88452b..00000000000
--- a/jstests/sharding/topology_changes_bump_topology_time.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-1) Add shard
-2) topology time must increase
-3) remove shard
-4) topology time must increase
-*/
-
-function cmdAsInternalClient(st, cmd) {
- const command =
- {[cmd]: 1, internalClient: {minWireVersion: NumberInt(0), maxWireVersion: NumberInt(7)}};
- const connInternal = new Mongo(st.configRS.getPrimary().host);
- const res = assert.commandWorked(connInternal.adminCommand(command));
- connInternal.close();
- return res;
-}
-
-function getTopologyTimeAsJson(st) {
- let res = cmdAsInternalClient(st, "hello");
- return tojson(res.$topologyTime);
-}
-
-function printConfigShards(st, msg) {
- print(msg, tojson(st.s.getDB("config").shards.find().toArray()));
-}
-
-(function() {
-
-'use strict';
-
-var st = new ShardingTest({shards: 1, rs: {nodes: 1}, config: 3});
-
-let initialTopology = getTopologyTimeAsJson(st);
-
-// AddShard
-let rs = new ReplSetTest({name: "rs1", nodes: 1});
-rs.startSet({shardsvr: ""});
-rs.initiate();
-rs.awaitReplication();
-
-assert.commandWorked(st.s.getDB("admin").runCommand({addShard: rs.getURL(), name: "rs1"}));
-
-let topologyTimeAfterAddShard = getTopologyTimeAsJson(st);
-
-// topology time must increase
-assert.gt(topologyTimeAfterAddShard,
- initialTopology,
- "Current topologyTime should change after add shard, but it did not");
-
-assert.commandWorked(st.s.adminCommand({removeShard: "rs1"}));
-printConfigShards(st, "config.shards after first remove shard ");
-
-assert.commandWorked(st.s.adminCommand({removeShard: "rs1"}));
-printConfigShards(st, "config.shards after second remove shard ");
-
-let topologyTimeAfterRemoveShard = getTopologyTimeAsJson(st);
-
-// topology time should change
-assert.gt(topologyTimeAfterRemoveShard,
- topologyTimeAfterAddShard,
- "Current topologyTime should change after remove shard, but it did not");
-
-rs.stopSet();
-st.stop();
-})();