diff options
author | Silvia Surroca <silvia.surroca@mongodb.com> | 2022-06-07 09:35:02 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-06-07 09:56:09 +0000 |
commit | e97fa5d06b9f43a47ac29c85e3971e366f193d11 (patch) | |
tree | daa2caed0347740e5783a03bc158983600b99a61 | |
parent | 88e695b37b5abe9eb17009f42afef014cf596a87 (diff) | |
download | mongo-e97fa5d06b9f43a47ac29c85e3971e366f193d11.tar.gz |
SERVER-66433 Backport deadline waiting for overlapping range deletion to finish to pre-v5.1 versions
-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 02243ac27f3..f4ce80806b9 100644 --- a/src/mongo/db/s/migration_destination_manager.cpp +++ b/src/mongo/db/s/migration_destination_manager.cpp @@ -962,6 +962,10 @@ 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) { + const auto rangeDeletionWaitDeadline = + outerOpCtx->getServiceContext()->getFastClockSource()->now() + + Milliseconds(receiveChunkWaitForRangeDeleterTimeoutMS.load()); + while (migrationutil::checkForConflictingDeletions( outerOpCtx, range, donorCollectionOptionsAndIndexes.uuid)) { uassert(ErrorCodes::ResumableRangeDeleterDisabled, @@ -988,6 +992,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 |