summaryrefslogtreecommitdiff
path: root/jstests/replsets/rollback_index_build_start_abort_not_create.js
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2019-12-16 18:49:39 +0000
committerevergreen <evergreen@mongodb.com>2019-12-16 18:49:39 +0000
commit59152df7655101ee551d6432727170b42fcd136f (patch)
tree0036dd72644c697f4a1e265f1eee948b9cfaa913 /jstests/replsets/rollback_index_build_start_abort_not_create.js
parent4cba7e97d3561efe26a7145c03bb91648343f396 (diff)
downloadmongo-59152df7655101ee551d6432727170b42fcd136f.tar.gz
SERVER-39452 Support rollback via refetch for two-phase index builds
Diffstat (limited to 'jstests/replsets/rollback_index_build_start_abort_not_create.js')
-rw-r--r--jstests/replsets/rollback_index_build_start_abort_not_create.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/jstests/replsets/rollback_index_build_start_abort_not_create.js b/jstests/replsets/rollback_index_build_start_abort_not_create.js
new file mode 100644
index 00000000000..00c8c36a9ee
--- /dev/null
+++ b/jstests/replsets/rollback_index_build_start_abort_not_create.js
@@ -0,0 +1,28 @@
+/**
+ * Test that rolling back an index build, but not collection creation, behaves correctly even when
+ * the index build is aborted.
+ */
+(function() {
+"use strict";
+
+// For RollbackIndexBuildsTest
+load('jstests/replsets/libs/rollback_index_builds_test.js');
+
+const rollbackIndexTest = new RollbackIndexBuildsTest();
+
+const schedule = [
+ // Create the collection
+ "createColl",
+ // Hold the stable timestamp, if applicable.
+ "holdStableTimestamp",
+ // Everything after this will be rolled-back.
+ "transitionToRollback",
+ // The index build will be rolled-back.
+ "start",
+ // Abort the index build
+ "abort",
+];
+
+rollbackIndexTest.runSchedules([schedule]);
+rollbackIndexTest.stop();
+})();