Skip to content

Commit

Permalink
SERVER-11032: Do not veto if primary is the node trying to be elected
Browse files Browse the repository at this point in the history
  • Loading branch information
scotthernandez authored and monkey101 committed Oct 4, 2013
1 parent 577fe66 commit c531824
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mongo/db/repl/consensus.cpp
Expand Up @@ -61,7 +61,9 @@ namespace mongo {
return true;
}

if (primary && primary->hbinfo().opTime >= hopeful->hbinfo().opTime) {
if (primary &&
(hopeful->hbinfo().id() != primary->hbinfo().id()) &&
(primary->hbinfo().opTime >= hopeful->hbinfo().opTime)) {
// other members might be aware of more up-to-date nodes
errmsg = str::stream() << hopeful->fullName() <<
" is trying to elect itself but " << primary->fullName() <<
Expand Down

0 comments on commit c531824

Please sign in to comment.