]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: AuthMonitor: always encode full regardless of keyserver having keys 2134/head
authorJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 21 Jul 2014 23:25:37 +0000 (00:25 +0100)
committerJoao Eduardo Luis <jecluis@gmail.com>
Tue, 22 Jul 2014 21:13:42 +0000 (22:13 +0100)
commit5f4ceb208b55fab7fd1530dcf8fe03198b044148
tree04613886dafa235d8f2f953c084fcf96af31b6ab
parent5c1d74848863b45aa9e98d134cbe0cd1c8199557
mon: AuthMonitor: always encode full regardless of keyserver having keys

On clusters without cephx, assuming an admin never added a key to the
cluster, the monitors have empty key servers.  A previous patch had the
AuthMonitor not encoding an empty keyserver as a full version.

As such, whenever the monitor restarts we will have to read the whole
state from disk in the form of incrementals.  This poses a problem upon
trimming, as we do every now and then: whenever we start the monitor, it
will start with an empty keyserver, waiting to be populated from whatever
we have on disk.  This is performed in update_from_paxos(), and the
AuthMonitor's will rely on the keyserver version to decide which
incrementals we care about -- basically, all versions > keyserver version.

Although we started with an empty keyserver (version 0) and are expecting
to read state from disk, in this case it means we will attempt to read
version 1 first.  If the cluster has been running for a while now, and
even if no keys have been added, it's fair to assume that version is
greater than 0 (or even 1), as the AuthMonitor also deals and keeps track
of auth global ids.  As such, we expect to read version 1, then version 2,
and so on.  If we trim at some point however this will not be possible,
as version 1 will not exist -- and we will assert because of that.

This is fixed by ensuring the AuthMonitor keeps track of full versions
of the key server, even if it's of an empty key server -- it will still
keep track of the key server's version, which is incremented each time
we update from paxos even if it is empty.

Fixes: #8851
Backport: dumpling, firefly

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit b551ae2bcea2dd17b37f5f5ab34251cc78de0e26)
src/mon/AuthMonitor.cc