]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: only clog changes to active 18600/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 27 Oct 2017 19:36:06 +0000 (12:36 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 6 Nov 2017 23:00:10 +0000 (10:00 +1100)
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>
src/mon/MDSMonitor.cc

index 159242228e19c1e198a75e5d78cd2f37763dcefb..4159d341d00da9a492a7bbb7e23fce0e02ebce2c 100644 (file)
@@ -734,20 +734,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;
+      });
     }
   }