jstests/sharding/index_operations_abort_concurrent_outgoing_migrations.js
/*
 * Runs moveChunk to move the initial chunk from the primary shard (shard0) to shard1. Pauses
 * the migration at the given step and runs the given command function. Asserts that the command
 * aborts the outgoing migration.
 */
Runs moveChunk to move the initial chunk from the primary shard (shard0) to shard1. Pauses
the migration at the given step and runs the given command function. Asserts that the command
aborts the outgoing migration.
Runs moveChunk to move the initial chunk from the primary shard ( shard0 ) to shard1 . Pauses the migration at the given step and runs the given command function . Asserts that the command aborts the outgoing migration .
function assertCommandAbortsConcurrentOutgoingMigration(st, stepName, ns, cmdFunc) {
    const fromShard = st.shard0;
    const toShard = st.shard1;
    pauseMoveChunkAtStep(fromShard, stepName);
    let moveChunkThread = new Thread(runMoveChunk, st.s.host, ns, {_id: MinKey}, toShard.shardName);
    moveChunkThread.start();
    waitForMoveChunkStep(fromShard, stepName);
    cmdFunc();
    unpauseMoveChunkAtStep(fromShard, stepName);
    moveChunkThread.join();
    assert.commandFailedWithCode(moveChunkThread.returnData(), ErrorCodes.Interrupted);
}
function assertCommandAbortsConcurrentOutgoingMigration ( st , stepName , ns , cmdFunc ) { const fromShard = st . shard0 ; const toShard = st . shard1 ; pauseMoveChunkAtStep ( fromShard , stepName ) ; let moveChunkThread = new Thread ( runMoveChunk , st . s . host , ns , { _id : MinKey } , toShard . shardName ) ; moveChunkThread . start ( ) ; waitForMoveChunkStep ( fromShard , stepName ) ; cmdFunc ( ) ; unpauseMoveChunkAtStep ( fromShard , stepName ) ; moveChunkThread . join ( ) ; assert . commandFailedWithCode ( moveChunkThread . returnData ( ) , ErrorCodes . Interrupted ) ; }
Runs moveChunk to move the initial chunk from the primary shard (shard0) to shard1.
Runs moveChunk to move the initial chunk from the primary shard ( shard0 ) to shard1 .
// Turn on the fail point and wait for moveChunk to hit the fail point. // Turn off the fail point and wait for moveChunk to complete.