jstests/sharding/index_operations_abort_concurrent_outgoing_migrations.js
/*
 * Runs moveChunk on the host to move the chunk to the given shard.
 */
Runs moveChunk on the host to move the chunk to the given shard.
Runs moveChunk on the host to move the chunk to the given shard .
function runMoveChunk(host, ns, findCriteria, toShard) {
    const mongos = new Mongo(host);
    let res, hasRetriableError;
    do {
        hasRetriableError = false;
        res = mongos.adminCommand({moveChunk: ns, find: findCriteria, to: toShard});
        if (!res.ok && res.code === ErrorCodes.ConflictingOperationInProgress) {
            hasRetriableError = true;
        }
    } while (hasRetriableError);
    return res;
}
function runMoveChunk ( host , ns , findCriteria , toShard ) { const mongos = new Mongo ( host ) ; let res , hasRetriableError ; do { hasRetriableError = false ; res = mongos . adminCommand ( { moveChunk : ns , find : findCriteria , to : toShard } ) ; if ( ! res . ok && res . code === ErrorCodes . ConflictingOperationInProgress ) { hasRetriableError = true ; } } while ( hasRetriableError ) ; return res ; }
Runs moveChunk on the host to move the chunk to the given shard.
Runs moveChunk on the host to move the chunk to the given shard .
// If a migration is interrupted by an index build, the test may run another migration // before the recipient discovers the first one failed, leading to transient // ConflictingOperationInProgress errors.