diff options
author | Milena Ivanova <milena.ivanova@mongodb.com> | 2020-09-25 16:24:37 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-29 11:39:42 +0000 |
commit | ebc57bb3708a807cb79cf905be1fbfc6430f6163 (patch) | |
tree | 5360d9c0ef6e2d5a041574db63c24b9ba45b17d0 | |
parent | dd3b30ae9b5d4d4a8fc4f51dd835265d4cfd67a9 (diff) | |
download | mongo-ebc57bb3708a807cb79cf905be1fbfc6430f6163.tar.gz |
SERVER-51171 Make sure replica set is completely started before awaitNodesAgreeOnAppliedOpTime
This fixes BF-18931
-rw-r--r-- | jstests/multiVersion/v2_delta_oplog_entries_fcv.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/jstests/multiVersion/v2_delta_oplog_entries_fcv.js b/jstests/multiVersion/v2_delta_oplog_entries_fcv.js index db50335567c..0336af94dab 100644 --- a/jstests/multiVersion/v2_delta_oplog_entries_fcv.js +++ b/jstests/multiVersion/v2_delta_oplog_entries_fcv.js @@ -5,7 +5,8 @@ (function() { "use strict"; -load("jstests/libs/curop_helpers.js"); // For waitForCurOpByFailPoint(). +load("jstests/libs/curop_helpers.js"); // For waitForCurOpByFailPoint(). +load("jstests/multiVersion/libs/multi_rs.js"); // For upgradeSet(). const kLatest = "latest"; const kLastStable = "4.4"; @@ -145,21 +146,18 @@ const rst = new ReplSetTest({nodes: 2, nodeOpts: {noCleanData: true}}); // The error code used by 4.4 in this scenario is different from the one used in 4.7+. const k44ApplyOpsUnknownUpdateVersionErrorCode = 40682; checkApplyOpsOfV2Entries(coll, k44ApplyOpsUnknownUpdateVersionErrorCode); - - rst.stopSet( - null, // signal - true // for restart - ); })(); // Start a latest replica set using the same data files. The set should start in FCV 4.4 by // default. (function runLatest() { - const nodes = rst.startSet({restart: true, binVersion: kLatest}); + rst.upgradeSet({binVersion: kLatest}); + // Wait until the set is fully operational and all nodes agree on the latest optime. + rst.awaitSecondaryNodes(); rst.awaitNodesAgreeOnAppliedOpTime(); // Step up node 0. Since we started with a high election timeout this would otherwise // take a while. - assert.commandWorked(nodes[0].adminCommand({replSetStepUp: 1})); + assert.commandWorked(rst.nodes[0].adminCommand({replSetStepUp: 1})); const primaryAdminDB = rst.getPrimary().getDB("admin"); checkFCV(primaryAdminDB, kLastStable); |