From 7f56da83d8ce91fa17bd5687a33747fe34e64cf8 Mon Sep 17 00:00:00 2001 From: Huayu Ouyang Date: Wed, 9 Jun 2021 15:55:01 +0000 Subject: SERVER-56004 Fix rollback_set_fcv.js where primary hangs when setting FCV after reconfig --- jstests/replsets/rollback_set_fcv.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jstests/replsets/rollback_set_fcv.js b/jstests/replsets/rollback_set_fcv.js index e84bc6e77bd..744165cfb34 100644 --- a/jstests/replsets/rollback_set_fcv.js +++ b/jstests/replsets/rollback_set_fcv.js @@ -15,6 +15,7 @@ load("jstests/replsets/libs/rollback_test.js"); load('jstests/libs/parallel_shell_helpers.js'); load("jstests/libs/fail_point_util.js"); +load("jstests/replsets/rslib.js"); function setFCV(fcv) { assert.commandFailedWithCode(db.adminCommand({setFeatureCompatibilityVersion: fcv}), @@ -37,6 +38,11 @@ function rollbackFCVFromDowngradingOrUpgrading(fromFCV, toFCV) { // Ensure the cluster starts at the correct FCV. assert.commandWorked(primary.adminCommand({setFeatureCompatibilityVersion: toFCV})); + // Wait until the config has propagated to the other nodes and the primary has learned of it, so + // that the config replication check in 'setFeatureCompatibilityVersion' is satisfied. This is + // only important since 'setFeatureCompatibilityVersion' is known to implicitly call internal + // reconfigs as part of upgrade/downgrade behavior. + rollbackTest.getTestFixture().waitForConfigReplication(primary); jsTestLog("Testing rolling back FCV from {version: " + lastLTSFCV + ", targetVersion: " + fromFCV + "} to {version: " + toFCV + "}"); -- cgit v1.2.1