diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2013-08-27 15:24:38 -0400 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2013-09-03 11:35:55 -0400 |
commit | fd0e48d5bd6826eebcf15608944e524082bd700d (patch) | |
tree | 50d2dfc414f18b120b151a95cf50773a877a1321 /src/mongo/db/repl | |
parent | a61f53f26f90d05ac2835f29ff6c2000308694e6 (diff) | |
download | mongo-fd0e48d5bd6826eebcf15608944e524082bd700d.tar.gz |
SERVER-10513 log warning about deprecation of votes in replica set config
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r-- | src/mongo/db/repl/rs_config.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/repl/rs_config.cpp b/src/mongo/db/repl/rs_config.cpp index 59b4b07a66b..530cb0df1e5 100644 --- a/src/mongo/db/repl/rs_config.cpp +++ b/src/mongo/db/repl/rs_config.cpp @@ -35,6 +35,7 @@ namespace mongo { mongo::mutex ReplSetConfig::groupMx("RS tag group"); const int ReplSetConfig::DEFAULT_HB_TIMEOUT = 10; + static AtomicUInt _warnedAboutVotes = 0; void logOpInitiate(const bo&); void assertOnlyHas(BSONObj o, const set<string>& fields) { @@ -535,6 +536,16 @@ namespace mongo { m.priority = mobj["priority"].Number(); if( mobj.hasElement("votes") ) m.votes = (unsigned) mobj["votes"].Number(); + if (m.votes > 1 && !_warnedAboutVotes) { + log() << "\t\tWARNING: Having more than 1 vote on a single replicaset member is" + << startupWarningsLog; + log() << "\t\tdeprecated, as it causes issues with majority write concern. For" + << startupWarningsLog; + log() << "\t\tmore information, see " + << "http://dochub.mongodb.org/core/replica-set-votes-deprecated" + << startupWarningsLog; + _warnedAboutVotes.set(1); + } if( mobj.hasElement("tags") ) { const BSONObj &t = mobj["tags"].Obj(); for (BSONObj::iterator c = t.begin(); c.more(); c.next()) { |