summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/repl/consensus.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/repl/consensus.cpp b/src/mongo/db/repl/consensus.cpp
index 9d0f7b8c20e..3d38b120ad8 100644
--- a/src/mongo/db/repl/consensus.cpp
+++ b/src/mongo/db/repl/consensus.cpp
@@ -207,16 +207,14 @@ namespace mongo {
log() << "replSet electCmdReceived couldn't find member with id " << whoid << rsLog;
vote = -10000;
}
- else if( primary && primary == rs._self && rs.lastOpTimeWritten >= hopeful->hbinfo().opTime ) {
- // hbinfo is not updated, so we have to check the primary's last optime separately
+ else if( primary && primary == rs._self) {
log() << "I am already primary, " << hopeful->fullName()
<< " can try again once I've stepped down" << rsLog;
vote = -10000;
}
- else if( primary && primary->hbinfo().opTime >= hopeful->hbinfo().opTime ) {
- // other members might be aware of more up-to-date nodes
+ else if (primary) {
log() << hopeful->fullName() << " is trying to elect itself but " <<
- primary->fullName() << " is already primary and more up-to-date" << rsLog;
+ primary->fullName() << " is already primary" << rsLog;
vote = -10000;
}
else if( highestPriority && highestPriority->config().priority > hopeful->config().priority) {