diff options
author | Pierlauro Sciarelli <pierlauro.sciarelli@mongodb.com> | 2021-03-11 17:30:12 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-11 18:42:46 +0000 |
commit | 254838f3481faa1b967d4c5798473b8bf5f4d384 (patch) | |
tree | a59e4573cf19721b2d0e47743e0c2cd02da90055 /src/mongo/db/s/range_deletion_util.h | |
parent | e2dd9ca37c2027541fe1eb8b4a14c767d4384d2a (diff) | |
download | mongo-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.h | 25 |
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 |