class MMDSBeacon : public PaxosServiceMessage {
- static const int HEAD_VERSION = 5;
+ static const int HEAD_VERSION = 6;
static const int COMPAT_VERSION = 2;
uuid_d fsid;
MDSMap::DaemonState state;
version_t seq;
- mds_rank_t standby_for_rank;
- string standby_for_name;
+
+ mds_rank_t standby_for_rank;
+ string standby_for_name;
+ fs_cluster_id_t standby_for_fscid;
CompatSet compat;
MMDSBeacon(const uuid_d &f, mds_gid_t g, string& n, epoch_t les, MDSMap::DaemonState st, version_t se, uint64_t feat) :
PaxosServiceMessage(MSG_MDS_BEACON, les, HEAD_VERSION, COMPAT_VERSION),
fsid(f), global_id(g), name(n), state(st), seq(se),
- standby_for_rank(MDS_RANK_NONE),
+ standby_for_rank(MDS_RANK_NONE), standby_for_fscid(FS_CLUSTER_ID_NONE),
mds_features(feat) {
}
private:
const char *get_type_name() const { return "mdsbeacon"; }
mds_rank_t get_standby_for_rank() { return standby_for_rank; }
const string& get_standby_for_name() { return standby_for_name; }
+ const fs_cluster_id_t& get_standby_for_fscid() { return standby_for_fscid; }
uint64_t get_mds_features() const { return mds_features; }
CompatSet const& get_compat() const { return compat; }
void set_standby_for_rank(mds_rank_t r) { standby_for_rank = r; }
void set_standby_for_name(string& n) { standby_for_name = n; }
void set_standby_for_name(const char* c) { standby_for_name.assign(c); }
+ void set_standby_for_fscid(fs_cluster_id_t f) { standby_for_fscid = f; }
const map<string, string>& get_sys_info() const { return sys_info; }
void set_sys_info(const map<string, string>& i) { sys_info = i; }
::encode(sys_info, payload);
}
::encode(mds_features, payload);
+ ::encode(standby_for_fscid, payload);
}
void decode_payload() {
bufferlist::iterator p = payload.begin();
if (header.version >= 5) {
::decode(mds_features, p);
}
+ if (header.version >= 6) {
+ ::decode(standby_for_fscid, p);
+ }
}
};
new_info.state_seq = seq;
new_info.standby_for_rank = m->get_standby_for_rank();
new_info.standby_for_name = m->get_standby_for_name();
+ new_info.standby_for_fscid = m->get_standby_for_fscid();
pending_fsmap.insert(new_info);
}
return false;
}
} else if (m->get_standby_for_rank() >= 0) {
- // TODO get this from MDS message
- // >>
- fs_cluster_id_t target_ns = FS_CLUSTER_ID_NONE;
- // <<
+ fs_cluster_id_t target_ns = m->get_standby_for_fscid();
mds_role_t target_role = {
target_ns == FS_CLUSTER_ID_NONE ?