summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2016-08-10 15:43:24 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2016-08-10 16:08:53 -0400
commit4af765175d02f20d3a2cdbbc8c04769d2bf443f7 (patch)
treeacc38822961dd58081806b33f64abeff092c810b
parente38918afa79bbb952e82a5127cb36d85f919703a (diff)
downloadmongo-4af765175d02f20d3a2cdbbc8c04769d2bf443f7.tar.gz
SERVER-25541 Fix waiting on slow stop and unexpected election in catchup.js
-rw-r--r--jstests/replsets/catchup.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/jstests/replsets/catchup.js b/jstests/replsets/catchup.js
index f93adf12c2b..3d661bb8e35 100644
--- a/jstests/replsets/catchup.js
+++ b/jstests/replsets/catchup.js
@@ -6,13 +6,13 @@ load("jstests/replsets/rslib.js");
"use strict";
var name = "catch_up";
- var rst = new ReplSetTest({name: name, nodes: 3});
+ var rst = new ReplSetTest({name: name, nodes: 3, useBridge: true});
rst.startSet();
var conf = rst.getReplSetConfig();
conf.settings = {
heartbeatIntervalMillis: 500,
- electionTimeoutMillis: 2000,
+ electionTimeoutMillis: 10000,
catchUpTimeoutMillis: 10000
};
rst.initiate(conf);
@@ -46,9 +46,15 @@ load("jstests/replsets/rslib.js");
jsTest.log("disable failpoint " + node.host);
assert.commandWorked(
node.adminCommand({configureFailPoint: 'stopOplogFetcher', mode: 'off'}));
- assert.commandWorked(
- node.adminCommand({configureFailPoint: 'pauseRsBgSyncProducer', mode: 'off'}),
- 'Failed to disable pauseRsBgSyncProducer failpoint.');
+ try {
+ assert.commandWorked(
+ node.adminCommand({configureFailPoint: 'pauseRsBgSyncProducer', mode: 'off'}),
+ 'Failed to disable pauseRsBgSyncProducer failpoint.');
+ } catch (ex) {
+ // Enable bgsync producer may cause rollback, which will close all connections
+ // including the one sending "configureFailPoint".
+ print("got exception when disabling fail point 'pauseRsBgSyncProducer': " + e);
+ }
}
function stepUp(node) {
@@ -157,8 +163,8 @@ load("jstests/replsets/rslib.js");
// Wait until it catches up with the old primary.
disableFailPoint(oldSecondaries[1]);
awaitOpTime(oldSecondaries[1], latestOp.ts);
- // Shutdown the old primary
- rst.stop(oldPrimary);
+ // Disconnect the new primary and the old one.
+ oldPrimary.disconnect(newPrimary);
// Disable the failpoint, the new primary should sync from the other secondary.
disableFailPoint(newPrimary);
assert.eq(newPrimary, rst.getPrimary());