summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuayu Ouyang <huayu.ouyang@mongodb.com>2022-01-06 21:14:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-20 02:20:16 +0000
commit68be7c70f5ba60a745507515243bdd376f737e91 (patch)
tree74cfaa7b665b55b64e88c94665375bb91ffe94e5
parentd4547038eb2e8f3620162d3e1730cd8cbec654b2 (diff)
downloadmongo-68be7c70f5ba60a745507515243bdd376f737e91.tar.gz
SERVER-62380 Wait for majority commit point to be advanced on secondary before starting rollback test in rollback_set_fcv.js
(cherry picked from commit d9f48866389096561f9d2582de141e068928f1d6)
-rw-r--r--jstests/replsets/rollback_set_fcv.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/jstests/replsets/rollback_set_fcv.js b/jstests/replsets/rollback_set_fcv.js
index a00c30f3bc0..3aa019c2d06 100644
--- a/jstests/replsets/rollback_set_fcv.js
+++ b/jstests/replsets/rollback_set_fcv.js
@@ -38,6 +38,11 @@ function rollbackFCVFromDowngradingOrUpgrading(fromFCV, toFCV) {
// Ensure the cluster starts at the correct FCV.
assert.commandWorked(primary.adminCommand({setFeatureCompatibilityVersion: toFCV}));
+ // Wait for the majority commit point to be updated on the secondary, because checkFCV calls
+ // getParameter for the featureCompatibilityVersion, which will wait until the FCV change makes
+ // it into the node's majority committed snapshot.
+ rollbackTest.getTestFixture().awaitLastOpCommitted(undefined /* timeout */, [secondary]);
+
jsTestLog("Testing rolling back FCV from {version: " + lastStableFCV +
", targetVersion: " + fromFCV + "} to {version: " + toFCV + "}");
@@ -77,6 +82,10 @@ function rollbackFCVFromDowngradedOrUpgraded(fromFCV, toFCV, failPoint) {
// Complete the upgrade/downgrade to ensure we are not in the upgrading/downgrading state.
assert.commandWorked(primary.adminCommand({setFeatureCompatibilityVersion: toFCV}));
+ // Wait for the majority commit point to be updated on the secondary, because checkFCV calls
+ // getParameter for the featureCompatibilityVersion, which will wait until the FCV change makes
+ // it into the node's majority committed snapshot.
+ rollbackTest.getTestFixture().awaitLastOpCommitted(undefined /* timeout */, [secondary]);
jsTestLog("Testing rolling back FCV from {version: " + fromFCV +
"} to {version: " + lastStableFCV + ", targetVersion: " + fromFCV + "}");