diff options
author | Silvia Surroca <silvia.surroca@mongodb.com> | 2022-06-07 09:42:10 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-06-07 10:05:35 +0000 |
commit | ad54048f491d9ebdc107b8bda1be33106fa4ef7a (patch) | |
tree | 4ac281f1f9ebdda7a34184461e9c10b302c868df /src | |
parent | d82ca41b32e48ff1e9794390208980cae47d3f3d (diff) | |
download | mongo-ad54048f491d9ebdc107b8bda1be33106fa4ef7a.tar.gz |
SERVER-66433 Backport deadline waiting for overlapping range deletion to finish to pre-v5.1 versions
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/s/migration_destination_manager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/s/migration_destination_manager.cpp b/src/mongo/db/s/migration_destination_manager.cpp index e01111db583..dabab95c18a 100644 --- a/src/mongo/db/s/migration_destination_manager.cpp +++ b/src/mongo/db/s/migration_destination_manager.cpp @@ -982,6 +982,10 @@ void MigrationDestinationManager::_migrateDriver(OperationContext* outerOpCtx) { // 1. Ensure any data which might have been left orphaned in the range being moved has been // deleted. + const auto rangeDeletionWaitDeadline = + outerOpCtx->getServiceContext()->getFastClockSource()->now() + + Milliseconds(receiveChunkWaitForRangeDeleterTimeoutMS.load()); + while (migrationutil::checkForConflictingDeletions( outerOpCtx, range, donorCollectionOptionsAndIndexes.uuid)) { uassert(ErrorCodes::ResumableRangeDeleterDisabled, @@ -1008,6 +1012,11 @@ void MigrationDestinationManager::_migrateDriver(OperationContext* outerOpCtx) { return; } + uassert(ErrorCodes::ExceededTimeLimit, + "Exceeded deadline waiting for overlapping range deletion to finish", + outerOpCtx->getServiceContext()->getFastClockSource()->now() < + rangeDeletionWaitDeadline); + // 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 |