diff options
author | Jordi Serra Torrens <jordi.serra-torrens@mongodb.com> | 2021-09-28 12:58:10 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-28 13:10:52 +0000 |
commit | 77e19ae35b3ed0ddcf260103df4d61b53941b27c (patch) | |
tree | 588ba2665be1f38d866aafe687772282b5c93438 | |
parent | b56a070b86d9bb8c526a635ce2304de60c1c2e46 (diff) | |
download | mongo-77e19ae35b3ed0ddcf260103df4d61b53941b27c.tar.gz |
SERVER-60142 Fix MigrationDestinationManager's check for overlapping rangeDeletion tasks
-rw-r--r-- | src/mongo/db/s/migration_destination_manager.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/s/migration_destination_manager.cpp b/src/mongo/db/s/migration_destination_manager.cpp index b6e4b3abf1c..b4ad2ae10fc 100644 --- a/src/mongo/db/s/migration_destination_manager.cpp +++ b/src/mongo/db/s/migration_destination_manager.cpp @@ -960,8 +960,8 @@ void MigrationDestinationManager::_migrateDriver(OperationContext* outerOpCtx) { // 1. Ensure any data which might have been left orphaned in the range being moved has been // deleted. if (_useFCV44RangeDeleterProtocol) { - if (migrationutil::checkForConflictingDeletions( - outerOpCtx, range, donorCollectionOptionsAndIndexes.uuid)) { + while (migrationutil::checkForConflictingDeletions( + outerOpCtx, range, donorCollectionOptionsAndIndexes.uuid)) { uassert(ErrorCodes::ResumableRangeDeleterDisabled, "Failing migration because the disableResumableRangeDeleter server " "parameter is set to true on the recipient shard, which contains range " @@ -985,6 +985,12 @@ void MigrationDestinationManager::_migrateDriver(OperationContext* outerOpCtx) { _setStateFail(redact(status.toString())); return; } + + // If the filtering metadata was cleared while the range deletion task was ongoing, then + // 'waitForClean' would return immediately even though there really is an ongoing range + // deletion task. For that case, we loop again until there is no conflicting task in + // config.rangeDeletions + outerOpCtx->sleepFor(Milliseconds(1000)); } } else { // Synchronously delete any data which might have been left orphaned in the range |