summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/restart_node_with_bridge.js
diff options
context:
space:
mode:
authorKyle Suarez <kyle.suarez@mongodb.com>2018-04-24 13:36:37 -0400
committerKyle Suarez <kyle.suarez@mongodb.com>2018-04-24 13:36:37 -0400
commitb377d97f8b8e975036595445bd921ec70d42215a (patch)
tree1786c593b836dd293612692f745847f0fc76fc4e /jstests/noPassthrough/restart_node_with_bridge.js
parent3843a788e8b2999b152a66bc128db4f5dd217e6a (diff)
downloadmongo-b377d97f8b8e975036595445bd921ec70d42215a.tar.gz
SERVER-34622 use existing options in _unbridgedNodes if bridge is enabled
Otherwise, restarting a node will not use the correct options for when the node was originally brought up.
Diffstat (limited to 'jstests/noPassthrough/restart_node_with_bridge.js')
-rw-r--r--jstests/noPassthrough/restart_node_with_bridge.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/jstests/noPassthrough/restart_node_with_bridge.js b/jstests/noPassthrough/restart_node_with_bridge.js
new file mode 100644
index 00000000000..1774ce50167
--- /dev/null
+++ b/jstests/noPassthrough/restart_node_with_bridge.js
@@ -0,0 +1,23 @@
+/**
+ * Tests that a node can be successfully restarted when the bridge is enabled.
+ * @tags: [requires_persistence, requires_replication]
+ */
+(function() {
+ "use strict";
+
+ const name = "restart_node_with_bridge";
+ const rst = new ReplSetTest({name: name, nodes: 1, useBridge: true});
+ rst.startSet();
+ rst.initiate();
+ rst.awaitNodesAgreeOnPrimary();
+
+ let primary = rst.getPrimary();
+ assert.commandWorked(primary.getDB("test").getCollection(name).insert({_id: 1}));
+
+ rst.restart(primary);
+ rst.awaitNodesAgreeOnPrimary();
+ primary = rst.getPrimary();
+ assert.eq(primary.getDB("test").getCollection(name).count({_id: 1}), 1);
+
+ rst.stopSet();
+}());