Skip to content

Commit

Permalink
Merge pull request #8970 from Abhishekvrshny/wip-15732-jewel
Browse files Browse the repository at this point in the history
jewel: MDS incarnation no longer gets lost after remove filesystem

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
  • Loading branch information
gregsfortytwo committed May 11, 2016
2 parents 7a37155 + 52ca195 commit bf1474f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/mds/FSMap.cc
Expand Up @@ -348,7 +348,8 @@ void FSMap::decode(bufferlist::iterator& p)
::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);
Expand Down Expand Up @@ -682,7 +683,7 @@ void FSMap::promote(
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
Expand Down
9 changes: 9 additions & 0 deletions src/mds/MDSMap.cc
Expand Up @@ -469,6 +469,13 @@ void MDSMap::mds_info_t::decode(bufferlist::iterator& bl)

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);
Expand Down Expand Up @@ -573,6 +580,8 @@ void MDSMap::encode(bufferlist& bl, uint64_t features) const

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);
Expand Down
2 changes: 1 addition & 1 deletion src/mds/MDSMap.h
Expand Up @@ -195,7 +195,7 @@ class MDSMap {
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
Expand Down
5 changes: 0 additions & 5 deletions src/mds/MDSRank.cc
Expand Up @@ -867,9 +867,6 @@ bool MDSRank::is_daemon_stopping() const
return stopping;
}

// FIXME>> this fns are state-machiney, not dispatchy
// >>>>>

void MDSRank::request_state(MDSMap::DaemonState s)
{
dout(3) << "request_state " << ceph_mds_state_name(s) << dendl;
Expand Down Expand Up @@ -1370,8 +1367,6 @@ void MDSRank::stopping_done()
request_state(MDSMap::STATE_STOPPED);
}

// <<<<<<<<

void MDSRankDispatcher::handle_mds_map(
MMDSMap *m,
MDSMap *oldmap)
Expand Down
1 change: 0 additions & 1 deletion src/mon/MDSMonitor.cc
Expand Up @@ -1680,7 +1680,6 @@ int MDSMonitor::management_command(

// 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;
Expand Down

0 comments on commit bf1474f

Please sign in to comment.