diff options
author | Huayu Ouyang <huayu.ouyang@mongodb.com> | 2022-01-06 21:14:52 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-20 00:56:53 +0000 |
commit | f87e64bcff8f095836c9fe3ba77499716c63f3e4 (patch) | |
tree | 5e4e61835eaf725c3553baac48be69eb4b5aedd7 | |
parent | 21537726d600f080bfd4527208a4c8b19f07c215 (diff) | |
download | mongo-f87e64bcff8f095836c9fe3ba77499716c63f3e4.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.js | 8 |
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 + "}"); |