]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: set leader commands prior to first election 1685/head
authorSage Weil <sage@inktank.com>
Thu, 17 Apr 2014 16:33:44 +0000 (09:33 -0700)
committerSage Weil <sage@inktank.com>
Thu, 17 Apr 2014 16:33:44 +0000 (09:33 -0700)
commit881680ee93c109453949599c1a82636df602921b
tree5f740c9381653c1620a57d39d5f718b8a80641b5
parenta8f0953974511cd2883bd5d678ff47c4574064ea
mon: set leader commands prior to first election

If we have just started and receive a command, we currently will reply with
EINVAL because the leader commands are empty.  Note that this race is very
difficult to reach because the (old) peon needs to forward a command to
the mon while it still thinks it has quorum, and the message needs to get
sent after the leader mon has restarted and reset its connection but before
it has declared a new election.

To fix this, we should assume at startup time that our commands are
valid.  If it is an internal command that does not require quorum, that
is fine.  If it does require quorum, we will retry the command after the
election completes and we will revalidate the command then.

Fixes: #8132
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.cc