]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: only clog changes to active 19055/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 27 Oct 2017 19:36:06 +0000 (12:36 -0700)
committerShinobu Kinjo <shinobu@redhat.com>
Mon, 20 Nov 2017 20:17:06 +0000 (05:17 +0900)
Otherwise we get constant INFO messages that an MDS is active.

Fixes: http://tracker.ceph.com/issues/21959
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 997a688d0809221500e0e3dd30e12ccec6c19780)

src/mon/MDSMonitor.cc

index 59ebaaf755e317c6accba5e5e297eddf831aef78..4643afdbd91e828b00b804ecad57f739fe589d23 100644 (file)
@@ -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;
+      });
     }
   }