]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: trigger transaction on MDS health changes
authorJohn Spray <john.spray@redhat.com>
Fri, 5 Sep 2014 11:49:53 +0000 (12:49 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 15 Sep 2014 14:05:14 +0000 (15:05 +0100)
I think this was previously only working as a side effect
of other MDS map changes.

Signed-off-by: John Spray <john.spray@redhat.com>
src/messages/MMDSBeacon.h
src/mon/MDSMonitor.cc

index 60adeadbe43e92d911159c80c59007414e4915db..dd79493a573f97b7004f1d711aad5f0c72752637 100644 (file)
@@ -75,6 +75,11 @@ struct MDSHealthMetric
     DECODE_FINISH(bl);
   }
 
+  bool operator==(MDSHealthMetric const &other) const
+  {
+    return (type == other.type && sev == other.sev && message == other.message);
+  }
+
   MDSHealthMetric() : type(MDS_HEALTH_NULL), sev(HEALTH_OK) {}
   MDSHealthMetric(mds_metric_t type_, health_status_t sev_, std::string const &message_)
     : type(type_), sev(sev_), message(message_) {}
@@ -101,6 +106,11 @@ struct MDSHealth
     ::decode(metrics, bl);
     DECODE_FINISH(bl);
   }
+
+  bool operator==(MDSHealth const &other) const
+  {
+    return metrics == other.metrics;
+  }
 };
 WRITE_CLASS_ENCODER(MDSHealth)
 
index 3139c9dd8d30affa6b9ea4c592adf93f896494f7..520eb6947c97e71c5e241266bbc04af282f49196 100644 (file)
@@ -319,6 +319,14 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
     return false;  // need to update map
   }
 
+  // Comparing known daemon health with m->get_health()
+  // and return false (i.e. require proposal) if they
+  // do not match, to update our stored
+  if (!(pending_daemon_health[gid] == m->get_health())) {
+    dout(20) << __func__ << " health metrics for gid " << gid << " were updated" << dendl;
+    return false;
+  }
+
  ignore:
   // note time and reply
   _note_beacon(m);