From bd3e7795ca9315aa4d550eeef42884f6f0516029 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 27 Oct 2017 12:36:06 -0700 Subject: [PATCH] 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) --- src/mon/MDSMonitor.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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; + }); } } -- 2.47.3