]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: OSDMonitor: only thrash and propose if we are the leader
authorSage Weil <sage@inktank.com>
Fri, 19 Jul 2013 23:36:01 +0000 (16:36 -0700)
committerSage Weil <sage@inktank.com>
Fri, 19 Jul 2013 23:39:49 +0000 (16:39 -0700)
commit8371680bab780933944dffd02246c73b17d6d930
treed5216ca3b7adf40ce80505333003bfcc07652c53
parente4f2e3ecd0aee8f30005f915595271c5ae2149cb
mon: OSDMonitor: only thrash and propose if we are the leader

'thrash_map' is only set if we are the leader, so we would thrash and
propose the pending value if we are the leader.  However, we should keep
the 'is_leader()' check not only for clarity's sake (an unfamiliar reader
may cry OMGBUG, prompting to a patch much like this), but also because
we may lose a subsequent election and become a peon instead, while still
holding a 'thrash_map' value > 0 -- and we really don't want to propose
while being a peon.

[This is a rebased version of 5eac38797d9eb5a59fcff1d81571cff7a2f10e66,
complete with the typo fix in d656aed599ee754646e16386ce5a4ab0117f2d6e.]

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/mon/OSDMonitor.cc