From 49153d63a1a19c8dbbd186a8542609b2e7f41d13 Mon Sep 17 00:00:00 2001 From: Jack Mulrow Date: Thu, 3 Sep 2020 18:25:30 +0000 Subject: SERVER-50545 Retry on ConflictingOperationInProgress in index_operations_abort_concurrent_outgoing_migrations.js --- ...index_operations_abort_concurrent_outgoing_migrations.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jstests/sharding/index_operations_abort_concurrent_outgoing_migrations.js b/jstests/sharding/index_operations_abort_concurrent_outgoing_migrations.js index 13004094d08..651fde8261d 100644 --- a/jstests/sharding/index_operations_abort_concurrent_outgoing_migrations.js +++ b/jstests/sharding/index_operations_abort_concurrent_outgoing_migrations.js @@ -16,7 +16,18 @@ TestData.skipCheckOrphans = true; */ function runMoveChunk(host, ns, findCriteria, toShard) { const mongos = new Mongo(host); - return mongos.adminCommand({moveChunk: ns, find: findCriteria, to: toShard}); + let res, hasRetriableError; + do { + hasRetriableError = false; + res = mongos.adminCommand({moveChunk: ns, find: findCriteria, to: toShard}); + // 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. + if (!res.ok && res.code === ErrorCodes.ConflictingOperationInProgress) { + hasRetriableError = true; + } + } while (hasRetriableError); + return res; } /* -- cgit v1.2.1