]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: Do not increase compatv when using monitor location or stretch mode
authorGreg Farnum <gfarnum@redhat.com>
Thu, 29 Oct 2020 05:58:56 +0000 (05:58 +0000)
committerGreg Farnum <gfarnum@redhat.com>
Fri, 6 Nov 2020 06:12:39 +0000 (06:12 +0000)
commit2e3643647bfbe955b54c62c8aaf114744dedb86e
tree62c2cbc94638aa9011f3069ef8f39380911b839f
parent0fe26f0ef7c6ecb93ae3627c6dcaf1f5276f5bd4
mon: Do not increase compatv when using monitor location or stretch mode

For mon_info_t, I first wrote things so that when monitors get a location
added in MonMap::mon_info_t, I bumped the struct_v to 5 and also bumped
the min_compat to 5. This made sure that nobody could decode the
struct and lose the location info, which if it were a monitor
would be very bad.

And for the MonMap, when stretch mode is enabled I bumped up the
comptav (in addition to the always-increased struct_v), for the same reason.

But clients also have to decode these structures, and we can't
disallow older clients from connecting to a stretched cluster.

Happily, usage of any stretch modes already requires a feature
bit and sets it as required in the monmap, so these are already
gated. Therefore, just don't set new compat values in these cases.

While at it, also gate setting the location on the monmap indicating
all monitors are updated.

Reported-by: Travis Nielsen <tnielsen@redhat.com>
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/mon/MonMap.cc
src/mon/MonmapMonitor.cc