summaryrefslogtreecommitdiff
path: root/jstests/replsets/chaining_removal.js
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2017-03-08 17:14:26 -0500
committerJudah Schvimer <judah@mongodb.com>2017-03-08 17:14:26 -0500
commitc05f900dd80342d0899f6461f845dc97fe942b01 (patch)
tree8a540d49401bfecced41b6cd5fd6a1659d4123a6 /jstests/replsets/chaining_removal.js
parentd44517bc2cfefbc3c1a68626d511f0e2ade559f6 (diff)
downloadmongo-c05f900dd80342d0899f6461f845dc97fe942b01.tar.gz
SERVER-27403 Ensure sync source is ahead and has not rolled back after first OplogFetcher batch
Diffstat (limited to 'jstests/replsets/chaining_removal.js')
-rw-r--r--jstests/replsets/chaining_removal.js24
1 files changed, 4 insertions, 20 deletions
diff --git a/jstests/replsets/chaining_removal.js b/jstests/replsets/chaining_removal.js
index ee70a00289e..bab3373bffa 100644
--- a/jstests/replsets/chaining_removal.js
+++ b/jstests/replsets/chaining_removal.js
@@ -2,6 +2,8 @@
(function() {
"use strict";
+ load("jstests/replsets/rslib.js");
+
var numNodes = 5;
var host = getHostName();
var name = "chaining_removal";
@@ -35,27 +37,9 @@
{configureFailPoint: 'disableMaxSyncSourceLagSecs', mode: 'alwaysOn'}));
// Force node 1 to sync directly from node 0.
- assert.commandWorked(nodes[1].getDB("admin").runCommand({"replSetSyncFrom": nodes[0].host}));
- var res;
- assert.soon(
- function() {
- res = nodes[1].getDB("admin").runCommand({"replSetGetStatus": 1});
- return res.syncingTo === nodes[0].host;
- },
- function() {
- return "node 1 failed to start syncing from node 0: " + tojson(res);
- });
-
+ syncFrom(nodes[1], nodes[0], replTest);
// Force node 4 to sync through node 1.
- assert.commandWorked(nodes[4].getDB("admin").runCommand({"replSetSyncFrom": nodes[1].host}));
- assert.soon(
- function() {
- res = nodes[4].getDB("admin").runCommand({"replSetGetStatus": 1});
- return res.syncingTo === nodes[1].host;
- },
- function() {
- return "node 4 failed to start chaining through node 1: " + tojson(res);
- });
+ syncFrom(nodes[4], nodes[1], replTest);
// write that should reach all nodes
var timeout = 60 * 1000;