summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2020-02-10 23:15:52 +0000
committerevergreen <evergreen@mongodb.com>2020-02-10 23:15:52 +0000
commit0b73485f6dd17e52f5810229fa09ba6e406633c6 (patch)
tree13c54e5d1b79ce8b5023687eebd5a96139882f7f
parentc245f97d019fb84e23243120b3f90032feba9dfe (diff)
downloadmongo-0b73485f6dd17e52f5810229fa09ba6e406633c6.tar.gz
SERVER-46050 Use getLastAppliedOpTime rather than getHeartbeatAppliedOpTime for checking primary's position
-rw-r--r--src/mongo/db/repl/topology_coordinator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/repl/topology_coordinator.cpp b/src/mongo/db/repl/topology_coordinator.cpp
index 832373164e9..a4e4ab8f9e9 100644
--- a/src/mongo/db/repl/topology_coordinator.cpp
+++ b/src/mongo/db/repl/topology_coordinator.cpp
@@ -283,7 +283,7 @@ HostAndPort TopologyCoordinator::chooseNewSyncSource(Date_t now,
<< "Cannot select a sync source because chaining is not allowed and we are primary";
_syncSource = HostAndPort();
return _syncSource;
- } else if (_memberData.at(_currentPrimaryIndex).getHeartbeatAppliedOpTime() <
+ } else if (_memberData.at(_currentPrimaryIndex).getLastAppliedOpTime() <
lastOpTimeFetched) {
LOG(1) << "Cannot select a sync source because chaining is not allowed and the primary "
"is behind me. Last oplog optime of primary {}: {}, my last fetched oplog "