diff options
author | Antonin Kral <a.kral@bobek.cz> | 2012-05-10 06:57:54 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2012-05-10 06:57:54 +0200 |
commit | 61619b3142c1de8f60f91964ff2656054d4f11a6 (patch) | |
tree | d3aaf9d1e70cac8efa0856e5b5ba39e2fb9dc526 /db/repl/manager.cpp | |
parent | eaaa7b30c99b89b5483e0a372bb73fe8c8695185 (diff) | |
download | mongodb-61619b3142c1de8f60f91964ff2656054d4f11a6.tar.gz |
Imported Upstream version 2.0.5
Diffstat (limited to 'db/repl/manager.cpp')
-rw-r--r-- | db/repl/manager.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/db/repl/manager.cpp b/db/repl/manager.cpp index c91adc3..fb9b6cb 100644 --- a/db/repl/manager.cpp +++ b/db/repl/manager.cpp @@ -98,8 +98,14 @@ namespace mongo { const Member *primary = rs->box.getPrimary(); if (primary && highestPriority && - highestPriority->config().priority > primary->config().priority) { - log() << "stepping down " << primary->fullName() << endl; + highestPriority->config().priority > primary->config().priority && + // if we're stepping down to allow another member to become primary, we + // better have another member (otherOp), and it should be up-to-date + otherOp != 0 && highestPriority->hbinfo().opTime.getSecs() >= otherOp - 10) { + log() << "stepping down " << primary->fullName() << " (priority " << + primary->config().priority << "), " << highestPriority->fullName() << + " is priority " << highestPriority->config().priority << " and " << + (otherOp - highestPriority->hbinfo().opTime.getSecs()) << " seconds behind" << endl; if (primary->h().isSelf()) { // replSetStepDown tries to acquire the same lock |