Skip to content

Commit 30fbdf4

Browse files
wh5aMongoDB Bot
authored andcommitted
SERVER-108091 Fix race in indexbg_killop_stepdown.js in 7.0 and 8.0 (#40030)
GitOrigin-RevId: 36f4cc332ab0759c258f7fbdd51c3e9ef57a280e
1 parent 3b369e5 commit 30fbdf4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jstests/noPassthrough/indexbg_killop_stepdown.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,17 @@ assert.commandWorked(primary.adminCommand({
6767
assert.commandWorked(testDB.adminCommand({replSetStepDown: 10, secondaryCatchUpPeriodSecs: 10}));
6868
rst.waitForState(primary, ReplSetTest.State.SECONDARY);
6969

70+
// Checking if a feature flag is enabled requires a connection to the primary. As a result, we must
71+
// run the check before resuming the abort (which may cause the primary to crash if the feature flag
72+
// is disabled).
73+
const gracefulIndexBuildFlag = FeatureFlagUtil.isEnabled(testDB, "IndexBuildGracefulErrorHandling");
74+
7075
// Resume the abort.
7176
assert.commandWorked(
7277
primary.adminCommand({configureFailPoint: "hangIndexBuildBeforeAbortCleanUp", mode: "off"}));
7378

7479
awaitIndexBuild();
7580

76-
const gracefulIndexBuildFlag = FeatureFlagUtil.isEnabled(testDB, "IndexBuildGracefulErrorHandling");
7781
if (!gracefulIndexBuildFlag) {
7882
// We expect the node to crash without this feature enabled.
7983
assert.soon(function() {

0 commit comments

Comments
 (0)