Skip to content

Commit

Permalink
mds: fix upgrades with replay daemons in map
Browse files Browse the repository at this point in the history
In the new world, a standby replay daemon which
is actively replaying has its rank set.  In the old
world it did not: map this during the upgrade/downgrade
paths in decode/encode.

Fixes: http://tracker.ceph.com/issues/15591
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit d94115a)
  • Loading branch information
John Spray authored and Abhishek Varshney committed May 6, 2016
1 parent 6c1b792 commit e6aa453
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/mds/FSMap.cc
Expand Up @@ -276,6 +276,15 @@ void FSMap::encode(bufferlist& bl, uint64_t features) const
for (const auto p : standby_daemons) {
full_mdsmap.mds_info[p.first] = p.second;
}

// Old MDSMaps don't set rank on standby replay daemons
for (auto &i : full_mdsmap.mds_info) {
auto &info = i.second;
if (info.state == MDSMap::STATE_STANDBY_REPLAY) {
info.rank = MDS_RANK_NONE;
}
}

full_mdsmap.encode(bl, features);
}
}
Expand Down Expand Up @@ -412,7 +421,12 @@ void FSMap::decode(bufferlist::iterator& p)

// Construct mds_roles, standby_daemons, and remove
// standbys from the MDSMap in the Filesystem.
for (const auto &p : migrate_fs->mds_map.mds_info) {
for (auto &p : migrate_fs->mds_map.mds_info) {
if (p.second.state == MDSMap::STATE_STANDBY_REPLAY) {
// In legacy MDSMap, standby replay daemons don't have
// rank set, but since FSMap they do.
p.second.rank = p.second.standby_for_rank;
}
if (p.second.rank == MDS_RANK_NONE) {
standby_daemons[p.first] = p.second;
standby_epochs[p.first] = epoch;
Expand Down

0 comments on commit e6aa453

Please sign in to comment.