diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2013-10-03 16:03:17 -0400 |
---|---|---|
committer | Dan Pasette <dan@mongodb.com> | 2013-10-04 11:58:54 -0400 |
commit | c53182403aae0eae655c34b848a61de92fd92566 (patch) | |
tree | 159de6a6660dd661e98384560b3c69c1b4cf43a1 /src/mongo/db | |
parent | 577fe667c612de137251b34f96535e3afc9ad4bb (diff) | |
download | mongo-c53182403aae0eae655c34b848a61de92fd92566.tar.gz |
SERVER-11032: Do not veto if primary is the node trying to be elected
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/repl/consensus.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/repl/consensus.cpp b/src/mongo/db/repl/consensus.cpp index f056befb605..dcb31408c11 100644 --- a/src/mongo/db/repl/consensus.cpp +++ b/src/mongo/db/repl/consensus.cpp @@ -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() << |