From ece8a907d7b0128f3840a0f3ddde6ab0d8e6ac19 Mon Sep 17 00:00:00 2001 From: Moustafa Maher Date: Mon, 25 May 2026 14:10:55 -0700 Subject: [PATCH] SERVER-127512 Fix index_build_killop_secondary_before_commit for in-memory suite (#54425) GitOrigin-RevId: db4b198c8f2b09a40175e62d9c3c7ba5d2e39a13 --- .../index_build_killop_secondary_before_commit.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/jstests/noPassthrough/index_builds/index_build_killop_secondary_before_commit.js b/jstests/noPassthrough/index_builds/index_build_killop_secondary_before_commit.js index 2afda2ac7c3..0073da40534 100644 --- a/jstests/noPassthrough/index_builds/index_build_killop_secondary_before_commit.js +++ b/jstests/noPassthrough/index_builds/index_build_killop_secondary_before_commit.js @@ -90,7 +90,17 @@ function killopIndexBuildOnSecondaryOnFailpoint(rst, failpointName, shouldSuccee // After restarting the secondary, expect that the index build completes successfully. rst.stop(secondary.nodeId, undefined, {forRestart: true, allowedExitCode: MongoRunner.EXIT_ABORT}); - rst.start(secondary.nodeId, undefined, true /* restart */); + // With an in-memory storage engine the secondary has no persistent state after a crash, so + // it must perform a full initial sync rather than crash-recovering from a checkpoint. We + // must disable initialSyncWaitForSyncSourceLastStableRecoveryTs because this is a PSA set + // and the majority of data-bearing members is 2. While the secondary is in initial sync + // (STARTUP2), the primary cannot advance its stable timestamp to beginApplyingTimestamp, + // leaving the secondary stuck in the wait loop (deadlock). + rst.start( + secondary.nodeId, + {setParameter: {initialSyncWaitForSyncSourceLastStableRecoveryTs: false}}, + true /* restart */, + ); secondary = rst.getSecondary(); secondaryDB = secondary.getDB(testDB.getName());