Instead, use the MDSMap epochs to provide the `inc` that
we populate into mds_info_t for use by the daemons.
It is not necessary to respect the current value of inc
in old maps, because the per-rank counters were necessarily
lower numbers than the overall map epoch (incrementing
the counters always corresponded to a map change).
Fixes: http://tracker.ceph.com/issues/15399
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit
30a375ebf814245fbbb5155fd39d8ff673f0a32a)
::decode(legacy_mds_map.modified, p);
::decode(legacy_mds_map.tableserver, p);
::decode(legacy_mds_map.in, p);
- ::decode(legacy_mds_map.inc, p);
+ std::map<mds_rank_t,int32_t> inc; // Legacy field, parse and drop
+ ::decode(inc, p);
::decode(legacy_mds_map.up, p);
::decode(legacy_mds_map.failed, p);
::decode(legacy_mds_map.stopped, p);
mds_map.failed.erase(assigned_rank);
}
info.rank = assigned_rank;
- info.inc = ++mds_map.inc[assigned_rank];
+ info.inc = epoch;
mds_roles[standby_gid] = filesystem->fscid;
// Update the rank state in Filesystem
void MDSMap::encode(bufferlist& bl, uint64_t features) const
{
+ std::map<mds_rank_t,int32_t> inc; // Legacy field, fake it so that
+ // old-mon peers have something sane
+ // during upgrade
+ for (const auto rank : in) {
+ inc.insert(std::make_pair(rank, epoch));
+ }
+
if ((features & CEPH_FEATURE_PGID64) == 0) {
__u16 v = 2;
::encode(v, bl);
void MDSMap::decode(bufferlist::iterator& p)
{
+ std::map<mds_rank_t,int32_t> inc; // Legacy field, parse and drop
+
cached_up_features = 0;
DECODE_START_LEGACY_COMPAT_LEN_16(5, 4, 4, p);
::decode(epoch, p);
mds_rank_t max_mds; /* The maximum number of active MDSes. Also, the maximum rank. */
std::set<mds_rank_t> in; // currently defined cluster
- std::map<mds_rank_t,int32_t> inc; // most recent incarnation.
+
// which ranks are failed, stopped, damaged (i.e. not held by a daemon)
std::set<mds_rank_t> failed, stopped, damaged;
std::map<mds_rank_t, mds_gid_t> up; // who is in those roles
// Carry forward what makes sense
new_fs->fscid = fs->fscid;
- new_fs->mds_map.inc = fs->mds_map.inc;
new_fs->mds_map.inline_data_enabled = fs->mds_map.inline_data_enabled;
new_fs->mds_map.max_mds = g_conf->max_mds;
new_fs->mds_map.data_pools = fs->mds_map.data_pools;