]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/HealthMontior: guard propose_pending() process
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 22 Jul 2017 06:05:32 +0000 (14:05 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 25 Jul 2017 02:24:44 +0000 (10:24 +0800)
Which is for leader only.
The current code logic has no problem but this is defensive
and therefore should be considered as a fine cleanup.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mon/HealthMonitor.cc

index 9775344aa57efc2d76339d0210d964b6f28dd17a..e9e5ad3aa4a23c55fbba507f0e536e9e35499ee5 100644 (file)
@@ -198,10 +198,11 @@ void HealthMonitor::tick()
   if (check_member_health()) {
     changed = true;
   }
-  if (mon->is_leader()) {
-    if (check_leader_health()) {
-      changed = true;
-    }
+  if (!mon->is_leader()) {
+    return;
+  }
+  if (check_leader_health()) {
+    changed = true;
   }
   if (changed) {
     propose_pending();