summaryrefslogtreecommitdiff
path: root/jstests/replsets/awaitable_hello_fcv_change.js
diff options
context:
space:
mode:
authorAli Mir <ali.mir@mongodb.com>2020-11-04 17:25:32 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-01-28 04:26:57 +0000
commit35a6a97338930d75a7f5cfd89671ae9af65aaf85 (patch)
treed0f026c6f06c0a38795fa4eaa56040d145034679 /jstests/replsets/awaitable_hello_fcv_change.js
parent5a5a75e4149faae8f1b6e95d60b84cc7f33d4e2b (diff)
downloadmongo-35a6a97338930d75a7f5cfd89671ae9af65aaf85.tar.gz
SERVER-50423 Change memberConfig's slaveDelay field to secondaryDelaySecs
Diffstat (limited to 'jstests/replsets/awaitable_hello_fcv_change.js')
-rw-r--r--jstests/replsets/awaitable_hello_fcv_change.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/jstests/replsets/awaitable_hello_fcv_change.js b/jstests/replsets/awaitable_hello_fcv_change.js
index 639c6475762..e814c79a207 100644
--- a/jstests/replsets/awaitable_hello_fcv_change.js
+++ b/jstests/replsets/awaitable_hello_fcv_change.js
@@ -21,6 +21,10 @@ const secondaryAdminDB = secondary.getDB("admin");
function runAwaitableHelloBeforeFCVChange(
topologyVersionField, targetFCV, isPrimary, prevMinWireVersion, serverMaxWireVersion) {
+ const isUseSecondaryDelaySecsEnabled = db.adminCommand({
+ getParameter: 1,
+ featureFlagUseSecondaryDelaySecs: 1
+ }).featureFlagUseSecondaryDelaySecs.value;
db.getMongo().setSecondaryOk();
let response = assert.commandWorked(db.runCommand({
hello: 1,
@@ -29,6 +33,22 @@ function runAwaitableHelloBeforeFCVChange(
internalClient:
{minWireVersion: NumberInt(0), maxWireVersion: NumberInt(serverMaxWireVersion)},
}));
+ // If 'featureFlagUseSecondaryDelaySecs' is enabled, the primary will reconfig the replica
+ // set on dowgrade. This reconfig will increment the 'topologyVersion'
+ // before the 'minWireVersion' is updated. Therefore, we send another 'hello'
+ // command to wait for the downgrade to complete before validating the
+ // 'minWireVersion'.
+ if (isUseSecondaryDelaySecsEnabled && prevMinWireVersion === response.minWireVersion) {
+ jsTestLog("Min wire version didn't change: " + prevMinWireVersion + ". Retrying hello.");
+ topologyVersionField = response.topologyVersion;
+ response = assert.commandWorked(db.runCommand({
+ hello: 1,
+ topologyVersion: topologyVersionField,
+ maxAwaitTimeMS: 99999999,
+ internalClient:
+ {minWireVersion: NumberInt(0), maxWireVersion: NumberInt(serverMaxWireVersion)},
+ }));
+ }
// We only expect to increment the server TopologyVersion when the minWireVersion has changed.
// This can only happen in two scenarios: