diff options
author | Paolo Polato <paolo.polato@mongodb.com> | 2022-11-16 21:52:32 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-11-16 22:48:22 +0000 |
commit | 925eaf9e18d9f560d4dbd0aaf6c86c2cde6e52d4 (patch) | |
tree | 03a2bb954808a3428a20fad7372ddd4b6a24b470 /src/mongo/db/s/rename_collection_participant_service.cpp | |
parent | 56f173061badee364bd965b740da7f8f31bc3b69 (diff) | |
download | mongo-925eaf9e18d9f560d4dbd0aaf6c86c2cde6e52d4.tar.gz |
SERVER-69775 Rename builder function for DDL phase handlers
Diffstat (limited to 'src/mongo/db/s/rename_collection_participant_service.cpp')
-rw-r--r-- | src/mongo/db/s/rename_collection_participant_service.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/mongo/db/s/rename_collection_participant_service.cpp b/src/mongo/db/s/rename_collection_participant_service.cpp index a9d1f29254e..746e7beb563 100644 --- a/src/mongo/db/s/rename_collection_participant_service.cpp +++ b/src/mongo/db/s/rename_collection_participant_service.cpp @@ -298,7 +298,7 @@ SemiFuture<void> RenameParticipantInstance::_runImpl( std::shared_ptr<executor::ScopedTaskExecutor> executor, const CancellationToken& token) noexcept { return ExecutorFuture<void>(**executor) - .then(_executePhase( + .then(_buildPhaseHandler( Phase::kBlockCRUDAndSnapshotRangeDeletions, [this, anchor = shared_from_this()] { auto opCtxHolder = cc().makeOperationContext(); @@ -339,7 +339,7 @@ SemiFuture<void> RenameParticipantInstance::_runImpl( snapshotRangeDeletionsForRename(opCtx, fromNss(), toNss()); })) - .then(_executePhase( + .then(_buildPhaseHandler( Phase::kRenameLocalAndRestoreRangeDeletions, [this, anchor = shared_from_this()] { auto opCtxHolder = cc().makeOperationContext(); @@ -355,25 +355,25 @@ SemiFuture<void> RenameParticipantInstance::_runImpl( restoreRangeDeletionTasksForRename(opCtx, toNss()); })) - .then( - _executePhase(Phase::kDeleteFromRangeDeletions, - [this, anchor = shared_from_this()] { - auto opCtxHolder = cc().makeOperationContext(); - auto* opCtx = opCtxHolder.get(); - deleteRangeDeletionTasksForRename(opCtx, fromNss(), toNss()); - - { - stdx::lock_guard<Latch> lg(_mutex); - if (!_blockCRUDAndRenameCompletionPromise.getFuture().isReady()) { - _blockCRUDAndRenameCompletionPromise.setFrom(Status::OK()); - } - } - - LOGV2(5515106, - "Collection locally renamed, waiting for CRUD to be unblocked", - "fromNs"_attr = fromNss(), - "toNs"_attr = toNss()); - })) + .then(_buildPhaseHandler( + Phase::kDeleteFromRangeDeletions, + [this, anchor = shared_from_this()] { + auto opCtxHolder = cc().makeOperationContext(); + auto* opCtx = opCtxHolder.get(); + deleteRangeDeletionTasksForRename(opCtx, fromNss(), toNss()); + + { + stdx::lock_guard<Latch> lg(_mutex); + if (!_blockCRUDAndRenameCompletionPromise.getFuture().isReady()) { + _blockCRUDAndRenameCompletionPromise.setFrom(Status::OK()); + } + } + + LOGV2(5515106, + "Collection locally renamed, waiting for CRUD to be unblocked", + "fromNs"_attr = fromNss(), + "toNs"_attr = toNss()); + })) .then([this, anchor = shared_from_this()] { if (_doc.getPhase() < Phase::kUnblockCRUD) { return _canUnblockCRUDPromise.getFuture(); @@ -381,7 +381,7 @@ SemiFuture<void> RenameParticipantInstance::_runImpl( return SemiFuture<void>::makeReady().share(); }) - .then(_executePhase( + .then(_buildPhaseHandler( Phase::kUnblockCRUD, [this, anchor = shared_from_this()] { auto opCtxHolder = cc().makeOperationContext(); |