From: Yan, Zheng Date: Tue, 1 Apr 2014 02:10:28 +0000 (+0800) Subject: mds: treat cluster as degraded when there is clientreplay MDS X-Git-Tag: v0.79~27^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1967f3251aac89327f7322a9a9e2251622a5865;p=ceph.git mds: treat cluster as degraded when there is clientreplay MDS 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 --- diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index 004a699068da..8046a7c4b359 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -477,12 +477,14 @@ public: 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::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();