summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
diff options
context:
space:
mode:
authorSuganthi Mani <suganthi.mani@mongodb.com>2018-07-27 09:13:56 -0400
committersmani87 <suganthi.mani@mongodb.com>2018-07-27 12:08:42 -0400
commit285c854b7243653e00f6f7678246fec0e8d7964a (patch)
tree5e3a7bbff7d5f60765a71cc50f80464b65db4e45 /src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
parent782aeea024538b2d3a0cc6c18bcd59835ff3a2a4 (diff)
downloadmongo-285c854b7243653e00f6f7678246fec0e8d7964a.tar.gz
SERVER-36050 Remove isV1ElectionProtocol() check.
Diffstat (limited to 'src/mongo/db/repl/replication_coordinator_external_state_impl.cpp')
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state_impl.cpp21
1 files changed, 9 insertions, 12 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 20d96481ace..91345c4c304 100644
--- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
@@ -483,8 +483,7 @@ void ReplicationCoordinatorExternalStateImpl::onDrainComplete(OperationContext*
}
}
-OpTime ReplicationCoordinatorExternalStateImpl::onTransitionToPrimary(OperationContext* opCtx,
- bool isV1ElectionProtocol) {
+OpTime ReplicationCoordinatorExternalStateImpl::onTransitionToPrimary(OperationContext* opCtx) {
invariant(opCtx->lockState()->isW());
// Clear the appliedThrough marker so on startup we'll use the top of the oplog. This must be
@@ -498,16 +497,14 @@ OpTime ReplicationCoordinatorExternalStateImpl::onTransitionToPrimary(OperationC
_replicationProcess->getConsistencyMarkers()->clearAppliedThrough(
opCtx, lastAppliedOpTime.getTimestamp());
- if (isV1ElectionProtocol) {
- writeConflictRetry(opCtx, "logging transition to primary to oplog", "local.oplog.rs", [&] {
- WriteUnitOfWork wuow(opCtx);
- opCtx->getClient()->getServiceContext()->getOpObserver()->onOpMessage(
- opCtx,
- BSON("msg"
- << "new primary"));
- wuow.commit();
- });
- }
+ writeConflictRetry(opCtx, "logging transition to primary to oplog", "local.oplog.rs", [&] {
+ WriteUnitOfWork wuow(opCtx);
+ opCtx->getClient()->getServiceContext()->getOpObserver()->onOpMessage(
+ opCtx,
+ BSON("msg"
+ << "new primary"));
+ wuow.commit();
+ });
const auto opTimeToReturn = fassert(28665, loadLastOpTime(opCtx));
_shardingOnTransitionToPrimaryHook(opCtx);