From: Patrick Donnelly Date: Fri, 27 Oct 2017 19:36:06 +0000 (-0700) Subject: MDSMonitor: only clog changes to active X-Git-Tag: v12.2.3~155^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd3e7795ca9315aa4d550eeef42884f6f0516029;p=ceph.git MDSMonitor: only clog changes to active Otherwise we get constant INFO messages that an MDS is active. Fixes: http://tracker.ceph.com/issues/21959 Signed-off-by: Patrick Donnelly (cherry picked from commit 997a688d0809221500e0e3dd30e12ccec6c19780) --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 59ebaaf755e3..4643afdbd91e 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -755,20 +755,20 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op) << ceph_mds_state_name(state) << dendl; return true; } else { - // Made it through special cases and validations, record the - // daemon's reported state to the FSMap. - pending_fsmap.modify_daemon(gid, [state, seq](MDSMap::mds_info_t *info) { - info->state = state; - info->state_seq = seq; - }); - - if (state == MDSMap::STATE_ACTIVE) { + if (info.state != MDSMap::STATE_ACTIVE && state == MDSMap::STATE_ACTIVE) { auto fscid = pending_fsmap.mds_roles.at(gid); auto fs = pending_fsmap.get_filesystem(fscid); mon->clog->info() << info.human_name() << " is now active in " << "filesystem " << fs->mds_map.fs_name << " as rank " << info.rank; } + + // Made it through special cases and validations, record the + // daemon's reported state to the FSMap. + pending_fsmap.modify_daemon(gid, [state, seq](MDSMap::mds_info_t *info) { + info->state = state; + info->state_seq = seq; + }); } }