From 8c276998839ab86e9b7d6fb2645b8f2ddb73668f Mon Sep 17 00:00:00 2001 From: Abdul Qadeer Date: Tue, 26 Jul 2022 18:11:22 +0000 Subject: SERVER-67457 Wait for majority commit on completion --- src/mongo/db/s/resharding/resharding_coordinator_service.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/s/resharding') diff --git a/src/mongo/db/s/resharding/resharding_coordinator_service.cpp b/src/mongo/db/s/resharding/resharding_coordinator_service.cpp index 85c14b6478f..9eb5b4a920d 100644 --- a/src/mongo/db/s/resharding/resharding_coordinator_service.cpp +++ b/src/mongo/db/s/resharding/resharding_coordinator_service.cpp @@ -1072,6 +1072,7 @@ ReshardingCoordinatorService::ReshardingCoordinator::_tellAllParticipantsReshard _cancelableOpCtxFactory.emplace(_ctHolder->getStepdownToken(), _markKilledExecutor); }) + .then([this] { return _waitForMajority(_ctHolder->getStepdownToken()); }) .then([this, executor]() { pauseBeforeTellDonorToRefresh.pauseWhileSet(); _establishAllDonorsAsParticipants(executor); @@ -1102,8 +1103,7 @@ ExecutorFuture ReshardingCoordinatorService::ReshardingCoordinator::_initi return resharding::WithAutomaticRetry([this, executor] { return ExecutorFuture(**executor) .then([this, executor] { _insertCoordDocAndChangeOrigCollEntry(); }) - .then([this, executor] { _calculateParticipantsAndChunksThenWriteToDisk(); }) - .then([this] { return _waitForMajority(_ctHolder->getAbortToken()); }); + .then([this, executor] { _calculateParticipantsAndChunksThenWriteToDisk(); }); }) .onTransientError([](const Status& status) { LOGV2(5093703, -- cgit v1.2.1