summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2014-11-24 17:57:45 -0500
committerErnie Hershey <ernie.hershey@10gen.com>2015-01-14 17:22:13 -0500
commit54be3ccc4f66b7a22ca1104cd02b43fc41dcbce4 (patch)
treefe51c4228f3251abe777442372ca5d9edcd84cf1
parent2d45919192d71bbb25af7436f5d4318943ac6053 (diff)
downloadmongo-54be3ccc4f66b7a22ca1104cd02b43fc41dcbce4.tar.gz
SERVER-16315 Nodes should not threaten to veto nodes whose config version is higher than their own.
-rw-r--r--src/mongo/db/repl/consensus.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/repl/consensus.cpp b/src/mongo/db/repl/consensus.cpp
index fc89d906a9d..c20a4216f3f 100644
--- a/src/mongo/db/repl/consensus.cpp
+++ b/src/mongo/db/repl/consensus.cpp
@@ -57,6 +57,12 @@ namespace mongo {
return false;
}
+ int cfgver = cmdObj["cfgver"].Int();
+ if (theReplSet->config().version < cfgver) {
+ // Our config is stale; do not veto.
+ return false;
+ }
+
unsigned id = cmdObj["id"].Int();
const Member* primary = theReplSet->box.getPrimary();
const Member* hopeful = theReplSet->findById(id);