]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
Elector: ignore messages from mons without required feature capabilities
authorGreg Farnum <greg@inktank.com>
Thu, 23 Jan 2014 21:08:26 +0000 (13:08 -0800)
committerGreg Farnum <greg@inktank.com>
Fri, 24 Jan 2014 20:33:56 +0000 (12:33 -0800)
commit687b570b719d34abebf1673b001f40b96e15189f
tree699053d9ce3d31ef0ec47c6d9d0a29b2c359201c
parent41796c07ac077678dce9db8d005e088e74ee71e3
Elector: ignore messages from mons without required feature capabilities

We maintain a list of required_features which the other monitor's features
must supply. This starts out at 0 and is initialized from the monitor's
list of features whenever we start electing.
Despite the scary sound of "just ignore it", this is safe: the monitor
will only record features as required once a quorum has formed in which
every monitor supports them. After that happens, monitors which do not
support those features will be unable to read the whole mon store/understand
the pg reports/whatever else, so letting them into the quorum would be buggy
behavior.
So if we ignore a monitor, it will not be able to start nor join
an election round with anybody who was in our quorum -- that is, the
ignored monitor cannot form a separate quorum. By ignoring it here, we
also prevent it from endlessly calling elections against the real
quorum.

Unfortunately there is no way to communicate to old monitors that they
cannot join the quorum -- there are no existing messages for that purpose,
and eg adding a new op to the MMonElection message will just cause it
to crash, which we don't want to do either.

Fixes: #7215
Signed-off-by: Greg Farnum <greg@inktank.com>
src/mon/Elector.cc
src/mon/Elector.h