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-06 21:42:14 +0000
commitd9f48866389096561f9d2582de141e068928f1d6 (patch)
tree47b0e419f503ff0128e72e4fb3393107fe9acb47
parent6c0a9bd4e888a8404df21976a222ec14beca06bf (diff)
downloadmongo-d9f48866389096561f9d2582de141e068928f1d6.tar.gz
SERVER-62380 Wait for majority commit point to be advanced on secondary before starting rollback test in rollback_set_fcv.js
-rw-r--r--jstests/replsets/rollback_set_fcv.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/replsets/rollback_set_fcv.js b/jstests/replsets/rollback_set_fcv.js
index 744165cfb34..cca6b6f074b 100644
--- a/jstests/replsets/rollback_set_fcv.js
+++ b/jstests/replsets/rollback_set_fcv.js
@@ -43,6 +43,10 @@ function rollbackFCVFromDowngradingOrUpgrading(fromFCV, toFCV) {
// only important since 'setFeatureCompatibilityVersion' is known to implicitly call internal
// reconfigs as part of upgrade/downgrade behavior.
rollbackTest.getTestFixture().waitForConfigReplication(primary);
+ // 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: " + lastLTSFCV +
", targetVersion: " + fromFCV + "} to {version: " + toFCV + "}");
@@ -83,6 +87,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: " + lastLTSFCV + ", targetVersion: " + fromFCV + "}");