summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/index_stepdown_after_init.js
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2019-07-12 11:20:33 -0400
committerBenety Goh <benety@mongodb.com>2019-07-12 11:20:47 -0400
commit0009dffe8fff9dc14b9cb31ce11851d916c2484a (patch)
tree24959151b4f03e1bdc0576e95f5b1c23ed0098bc /jstests/noPassthrough/index_stepdown_after_init.js
parent8bf0eddec8a2f5c9a3bfb49162a36a651615534f (diff)
downloadmongo-0009dffe8fff9dc14b9cb31ce11851d916c2484a.tar.gz
SERVER-42154 IndexBuildsCoordinator uses repl state info provided by caller
This affects index builds managed by the IndexBuildsCoordinator on primaries and mitigates changes in the replication state observed since the start of the index build that may affect how the index build handles interruptions and errors.
Diffstat (limited to 'jstests/noPassthrough/index_stepdown_after_init.js')
-rw-r--r--jstests/noPassthrough/index_stepdown_after_init.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/jstests/noPassthrough/index_stepdown_after_init.js b/jstests/noPassthrough/index_stepdown_after_init.js
index 0b5eccc27d8..c27df900ce0 100644
--- a/jstests/noPassthrough/index_stepdown_after_init.js
+++ b/jstests/noPassthrough/index_stepdown_after_init.js
@@ -59,13 +59,18 @@
{configureFailPoint: 'hangAfterInitializingIndexBuild', mode: 'off'}));
}
+ // Wait for the index build to stop.
+ IndexBuildTest.waitForIndexBuildToStop(testDB);
+
const exitCode = createIdx({checkExitSuccess: false});
assert.neq(
0, exitCode, 'expected shell to exit abnormally due to index build being terminated');
- rst.stop(primary, undefined, {allowedExitCode: MongoRunner.EXIT_ABORT});
- assert(rawMongoProgramOutput().match('Fatal assertion 51101 IndexBuildAborted: Index build: '),
- 'Index build should have aborted on step down.');
+ checkLog.contains(primary, 'IndexBuildAborted: Index build aborted: ');
+
+ // Check that no new index has been created. This verifies that the index build was aborted
+ // rather than successfully completed.
+ IndexBuildTest.assertIndexes(coll, 1, ['_id_']);
rst.stopSet();
})();