diff options
Diffstat (limited to 'jstests/noPassthrough/indexbg_restart_secondary.js')
-rw-r--r-- | jstests/noPassthrough/indexbg_restart_secondary.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/jstests/noPassthrough/indexbg_restart_secondary.js b/jstests/noPassthrough/indexbg_restart_secondary.js index efd6d90d765..66c27d0e0c3 100644 --- a/jstests/noPassthrough/indexbg_restart_secondary.js +++ b/jstests/noPassthrough/indexbg_restart_secondary.js @@ -69,11 +69,15 @@ IndexBuildTest.waitForIndexBuildToStart(secondDB, coll.getName(), "y_1"); MongoRunner.stopMongod(second); -replTest.start( - second, - {setParameter: {"failpoint.hangAfterSettingUpIndexBuildUnlocked": tojson({mode: "alwaysOn"})}}, - /*restart=*/true, - /*wait=*/true); +replTest.start(second, + { + setParameter: { + "failpoint.hangAfterSettingUpIndexBuildUnlocked": tojson({mode: "alwaysOn"}), + "failpoint.hangAfterSettingUpResumableIndexBuild": tojson({mode: "alwaysOn"}) + } + }, + /*restart=*/true, + /*wait=*/true); // Make sure secondary comes back. try { @@ -90,7 +94,11 @@ try { assert.eq(size, secondDB.getCollection(collectionName).find({}).itcount()); // Verify that only the _id index is ready. - checkLog.containsJson(second, 4585201); + if (ResumableIndexBuildTest.resumableIndexBuildsEnabled(second)) { + checkLog.containsJson(second, 4841704); + } else { + checkLog.containsJson(second, 4585201); + } IndexBuildTest.assertIndexes(secondDB.getCollection(collectionName), 4, ["_id_"], @@ -99,6 +107,8 @@ try { } finally { assert.commandWorked(second.adminCommand( {configureFailPoint: 'hangAfterSettingUpIndexBuildUnlocked', mode: 'off'})); + assert.commandWorked(second.adminCommand( + {configureFailPoint: 'hangAfterSettingUpResumableIndexBuild', mode: 'off'})); // Let index build complete on primary, which replicates a commitIndexBuild to the secondary. IndexBuildTest.resumeIndexBuilds(primaryDB); |