Files
mongo/jstests/replsets/rollback_index_build_and_create.js
Stephanie 62b275cd55 SERVER-109631 Disable commit quorum for primary-driven index builds (#40440)
GitOrigin-RevId: 0775d0213b61306d1239330d24b9ac65221d630d
2025-08-28 18:47:13 +00:00

28 lines
973 B
JavaScript

/**
* Test that rolling back an index build and collection creation behaves correctly.
* @tags: [
* # We don't need to handle rollbacks in primary-driven index builds.
* primary_driven_index_builds_incompatible,
* ]
*/
import {RollbackIndexBuildsTest} from "jstests/replsets/libs/rollback_index_builds_test.js";
const rollbackIndexTest = new RollbackIndexBuildsTest([ErrorCodes.InterruptedDueToReplStateChange]);
const schedule = [
// Hold the stable timestamp, if applicable.
"holdStableTimestamp",
// Everything after this will be rolled-back.
"transitionToRollback",
// This creates the collection and starts the index build, so both the collection creation and
// index build will be rolled-back.
"start",
// Allow the rollback to proceed.
"transitionToSteadyState",
// Allow the index build to proceed on the rolling-back node.
"commit",
];
rollbackIndexTest.runSchedules([schedule]);
rollbackIndexTest.stop();