diff options
author | Antonio Fuschetto <antonio.fuschetto@mongodb.com> | 2023-02-14 16:18:34 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-14 19:44:27 +0000 |
commit | 7923c15b7d285d18a0c81a1e55dc939c7320af39 (patch) | |
tree | d71dedb08dbe90c0bc2ac5ddb5763e8c6df00e9c | |
parent | dbfc672d325ee924f84c8856f490522c57635acc (diff) | |
download | mongo-7923c15b7d285d18a0c81a1e55dc939c7320af39.tar.gz |
SERVER-73971 Move `movePrimary` completion events to the last coordinator's phase
-rw-r--r-- | src/mongo/db/s/move_primary_coordinator.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mongo/db/s/move_primary_coordinator.cpp b/src/mongo/db/s/move_primary_coordinator.cpp index 04afaf3d810..e2b694f308a 100644 --- a/src/mongo/db/s/move_primary_coordinator.cpp +++ b/src/mongo/db/s/move_primary_coordinator.cpp @@ -196,7 +196,6 @@ ExecutorFuture<void> MovePrimaryCoordinator::runMovePrimaryWorkflow( } blockReads(opCtx); - enterCriticalSectionOnRecipient(opCtx); })) .then(_buildPhaseHandler( @@ -230,13 +229,6 @@ ExecutorFuture<void> MovePrimaryCoordinator::runMovePrimaryWorkflow( getForwardableOpMetadata().setOn(opCtx); dropStaleDataOnDonor(opCtx); - - LOGV2(7120206, - "Completed movePrimary operation", - "db"_attr = _dbName, - "to"_attr = _doc.getToShardId()); - - logChange(opCtx, "end"); })) .then(_buildPhaseHandler(Phase::kExitCriticalSection, [this, executor = executor, anchor = shared_from_this()] { @@ -251,8 +243,14 @@ ExecutorFuture<void> MovePrimaryCoordinator::runMovePrimaryWorkflow( } unblockReadsAndWrites(opCtx); - exitCriticalSectionOnRecipient(opCtx); + + LOGV2(7120206, + "Completed movePrimary operation", + "db"_attr = _dbName, + "to"_attr = _doc.getToShardId()); + + logChange(opCtx, "end"); })) .onError([this, anchor = shared_from_this()](const Status& status) { const auto opCtxHolder = cc().makeOperationContext(); |