summaryrefslogtreecommitdiff
path: root/src/mongo/db/s
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2022-06-08 07:13:15 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-06-08 07:41:02 +0000
commit36fd043c358946d78a7fad0d69c1d08deed2790e (patch)
treee0f5119d1edb15f93fbf0011a5b9a9c87c7d33c1 /src/mongo/db/s
parentada9a8dcd4d6548f70afbce6dcbe3f7920bce253 (diff)
downloadmongo-36fd043c358946d78a7fad0d69c1d08deed2790e.tar.gz
SERVER-66958 Handle potential multiple "processing" range deletions on step-up
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r--src/mongo/db/s/migration_util.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mongo/db/s/migration_util.cpp b/src/mongo/db/s/migration_util.cpp
index bd8600c1518..c3751d7bd5f 100644
--- a/src/mongo/db/s/migration_util.cpp
+++ b/src/mongo/db/s/migration_util.cpp
@@ -520,14 +520,27 @@ void resubmitRangeDeletionsOnStepUp(ServiceContext* serviceContext) {
FindCommandRequest findCommand(NamespaceString::kRangeDeletionNamespace);
findCommand.setFilter(BSON(RangeDeletionTask::kProcessingFieldName << true));
auto cursor = client.find(std::move(findCommand));
- if (cursor->more()) {
- return migrationutil::submitRangeDeletionTask(
+
+ auto retFuture = ExecutorFuture<void>(getMigrationUtilExecutor(serviceContext));
+
+ int rangeDeletionsMarkedAsProcessing = 0;
+ while (cursor->more()) {
+ retFuture = migrationutil::submitRangeDeletionTask(
opCtx.get(),
RangeDeletionTask::parse(IDLParserErrorContext("rangeDeletionRecovery"),
cursor->next()));
- } else {
- return ExecutorFuture<void>(getMigrationUtilExecutor(serviceContext));
+ rangeDeletionsMarkedAsProcessing++;
}
+
+ if (rangeDeletionsMarkedAsProcessing > 1) {
+ LOGV2_WARNING(
+ 6695800,
+ "Rescheduling several range deletions marked as processing. Orphans count "
+ "may be off while they are not drained",
+ "numRangeDeletionsMarkedAsProcessing"_attr = rangeDeletionsMarkedAsProcessing);
+ }
+
+ return retFuture;
})
.then([serviceContext] {
ThreadClient tc("ResubmitRangeDeletions", serviceContext);