summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/range_deletion_util.h
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2021-03-11 17:30:12 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-11 18:42:46 +0000
commit254838f3481faa1b967d4c5798473b8bf5f4d384 (patch)
treea59e4573cf19721b2d0e47743e0c2cd02da90055 /src/mongo/db/s/range_deletion_util.h
parente2dd9ca37c2027541fe1eb8b4a14c767d4384d2a (diff)
downloadmongo-254838f3481faa1b967d4c5798473b8bf5f4d384.tar.gz
SERVER-55113 Split rename/range-deletion procedures in idempotent steps
Diffstat (limited to 'src/mongo/db/s/range_deletion_util.h')
-rw-r--r--src/mongo/db/s/range_deletion_util.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/mongo/db/s/range_deletion_util.h b/src/mongo/db/s/range_deletion_util.h
index 6045975a293..bff30e76299 100644
--- a/src/mongo/db/s/range_deletion_util.h
+++ b/src/mongo/db/s/range_deletion_util.h
@@ -76,10 +76,27 @@ SharedSemiFuture<void> removeDocumentsInRange(
Seconds delayForActiveQueriesOnSecondariesToComplete,
Milliseconds delayBetweenBatches);
-std::vector<RangeDeletionTask> getPersistentRangeDeletionTasks(OperationContext* opCtx,
- const NamespaceString& nss);
-void storeRangeDeletionTasks(OperationContext* opCtx, std::vector<RangeDeletionTask>& tasks);
+/**
+ * - Retrieves source collection's persistent range deletion tasks from `config.rangeDeletions`
+ * - Associates tasks to the target collection
+ * - Stores tasks in `config.rangeDeletionsForRename`
+ */
+void snapshotRangeDeletionsForRename(OperationContext* opCtx,
+ const NamespaceString& fromNss,
+ const NamespaceString& toNss);
-void deleteRangeDeletionTasks(OperationContext* opCtx, const NamespaceString& nss);
+/**
+ * Copies `config.rangeDeletionsForRename` tasks for the specified namespace to
+ * `config.rangeDeletions`.
+ */
+void restoreRangeDeletionTasksForRename(OperationContext* opCtx, const NamespaceString& nss);
+
+/**
+ * - Deletes range deletion tasks for the FROM namespace from `config.rangeDeletions`.
+ * - Deletes range deletion tasks for the TO namespace from `config.rangeDeletionsForRename`
+ */
+void deleteRangeDeletionTasksForRename(OperationContext* opCtx,
+ const NamespaceString& fromNss,
+ const NamespaceString& toNss);
} // namespace mongo