summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2020-09-03 18:25:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-04 01:18:20 +0000
commit49153d63a1a19c8dbbd186a8542609b2e7f41d13 (patch)
tree5747d9e949cb8f186f677c3eabb98eb852e1017a /jstests
parent6a0b9444a3e0a0ca0fb473e4bd147a8676ca794e (diff)
downloadmongo-49153d63a1a19c8dbbd186a8542609b2e7f41d13.tar.gz
SERVER-50545 Retry on ConflictingOperationInProgress in index_operations_abort_concurrent_outgoing_migrations.js
Diffstat (limited to 'jstests')
-rw-r--r--jstests/sharding/index_operations_abort_concurrent_outgoing_migrations.js13
1 files changed, 12 insertions, 1 deletions
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;
}
/*