Skip to content

Commit

Permalink
mds: treat cluster as degraded when there is clientreplay MDS
Browse files Browse the repository at this point in the history
This forbids exporting subtrees and fragmenting dirfrags when there
is MDS in clientreplay state. During replaying client requests, the
MDS may need to authpin some remote objects. Exporting subtrees and
fragmenting dirfrags slow down replaying client requests.

Signed-off-by: Yan, Zheng <[email protected]>
  • Loading branch information
Yan, Zheng committed Apr 2, 2014
1 parent b65a818 commit d1967f3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/mds/MDSMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,14 @@ class MDSMap {
return in.size() >= max_mds;
}
bool is_degraded() const { // degraded = some recovery in process. fixes active membership and recovery_set.
return
get_num_mds(STATE_REPLAY) +
get_num_mds(STATE_RESOLVE) +
get_num_mds(STATE_RECONNECT) +
get_num_mds(STATE_REJOIN) +
failed.size();
if (!failed.empty())
return true;
for (map<uint64_t,mds_info_t>::const_iterator p = mds_info.begin();
p != mds_info.end();
++p)
if (p->second.state >= STATE_REPLAY && p->second.state <= STATE_CLIENTREPLAY)
return true;
return false;
}
bool is_any_failed() {
return failed.size();
Expand Down

0 comments on commit d1967f3

Please sign in to comment.