summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2022-01-04 11:06:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-04 11:33:22 +0000
commita9216c8728dc0f3f596db071031914978e2e8e08 (patch)
tree454d082641adf830c6f6254fa75372eb2a6056cb /src/mongo/db/repl
parent7d70b156eb30a857b372f671dc078173f66810b5 (diff)
downloadmongo-a9216c8728dc0f3f596db071031914978e2e8e08.tar.gz
SERVER-60109 Ensure vector clock is recovered on step-up
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state_impl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
index b3177b71eba..7f0baac36b0 100644
--- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
@@ -98,6 +98,7 @@
#include "mongo/db/system_index.h"
#include "mongo/db/vector_clock.h"
#include "mongo/db/vector_clock_metadata_hook.h"
+#include "mongo/db/vector_clock_mutable.h"
#include "mongo/executor/network_connection_hook.h"
#include "mongo/executor/network_interface.h"
#include "mongo/executor/network_interface_factory.h"
@@ -941,6 +942,7 @@ void ReplicationCoordinatorExternalStateImpl::_shardingOnTransitionToPrimaryHook
TransactionCoordinatorService::get(_service)->onStepUp(opCtx);
} else if (ShardingState::get(opCtx)->enabled()) {
Status status = ShardingStateRecovery::recover(opCtx);
+ VectorClockMutable::get(opCtx)->recoverDirect(opCtx);
// If the node is shutting down or it lost quorum just as it was becoming primary, don't
// run the sharding onStepUp machinery. The onStepDown counterpart to these methods is