summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Nelson <lamont.nelson@mongodb.com>2020-03-11 17:56:12 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-29 18:46:43 +0000
commit7fd3c03c548d0febfa1e871e16d638513c417c79 (patch)
tree4668844569dc6f727b5856916bc8694a4cca24d4
parent09c727b590720420f3cb206fe53931810638c336 (diff)
downloadmongo-7fd3c03c548d0febfa1e871e16d638513c417c79.tar.gz
SERVER-45009: Run onStepdown on the TransactionCoordinatorService to prevent tests from hanging at shutdown
(cherry picked from commit e4736e7d9e327eafe19e1281bb3942978ca3c353)
-rw-r--r--src/mongo/db/db.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 008cec9d986..4d20f50a16f 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -123,6 +123,7 @@
#include "mongo/db/s/shard_server_op_observer.h"
#include "mongo/db/s/sharding_initialization_mongod.h"
#include "mongo/db/s/sharding_state_recovery.h"
+#include "mongo/db/s/transaction_coordinator_service.h"
#include "mongo/db/s/wait_for_majority_service.h"
#include "mongo/db/server_options.h"
#include "mongo/db/service_context.h"
@@ -942,6 +943,10 @@ void shutdownTask(const ShutdownTaskArgs& shutdownArgs) {
log() << "Failed to stepDown in non-command initiated shutdown path "
<< e.toString();
}
+
+ // Even if the replCoordinator failed to step down, ensure we still shut down the
+ // TransactionCoordinatorService (see SERVER-45009)
+ TransactionCoordinatorService::get(serviceContext)->onStepDown();
}
}