0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-48027 Wait for applied OpLog agreement before restarting replica sets

This commit is contained in:
Sara Golemon 2020-05-07 21:38:54 +00:00 committed by Evergreen Agent
parent a709403384
commit 04bc9f02d9

View File

@ -111,9 +111,11 @@ replset.startSet();
replset.initiate();
replset.awaitSecondaryNodes();
runTest('ReplSet', {primary: replset.getPrimary(), replset: replset, wc: replsetWC}, function() {
const kAppliedOpTimeTimeoutMS = 10 * 1000;
// Need to be authed for restart.
// Only __system is guaranteed to be available, especially during 2nd restart.
replset.nodes.forEach((node) => assert(node.getDB('admin').auth('__system', keyfileContents)));
replset.awaitNodesAgreeOnAppliedOpTime(kAppliedOpTimeTimeoutMS, replset.nodes);
replset.restart(replset.nodes);
replset.awaitSecondaryNodes();
return {primary: replset.getPrimary(), replset: replset, wc: replsetWC};