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:
parent
a709403384
commit
04bc9f02d9
@ -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};
|
||||
|
Loading…
Reference in New Issue
Block a user