]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add 'osd heartbeat min healthy ratio' tunable 533/head
authorSage Weil <sage@inktank.com>
Fri, 23 Aug 2013 04:44:31 +0000 (21:44 -0700)
committerSage Weil <sage@inktank.com>
Fri, 23 Aug 2013 04:44:31 +0000 (21:44 -0700)
This was hard-coded to 1/3; make it tunable.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/config_opts.h
src/osd/OSD.cc

index b021651bd4d55e79a52d41511d6831ad43a017c3..ce3b78ca52e8598658024a4c428feb2e491f9ba9 100644 (file)
@@ -425,6 +425,11 @@ OPTION(osd_heartbeat_addr, OPT_ADDR, entity_addr_t())
 OPTION(osd_heartbeat_interval, OPT_INT, 6)       // (seconds) how often we ping peers
 OPTION(osd_heartbeat_grace, OPT_INT, 20)         // (seconds) how long before we decide a peer has failed
 OPTION(osd_heartbeat_min_peers, OPT_INT, 10)     // minimum number of peers
+
+// minimum number of peers tha tmust be reachable to mark ourselves
+// back up after being wrongly marked down.
+OPTION(osd_heartbeat_min_healthy_ratio, OPT_FLOAT, .33)
+
 OPTION(osd_mon_heartbeat_interval, OPT_INT, 30)  // (seconds) how often to ping monitor if no peers
 OPTION(osd_mon_report_interval_max, OPT_INT, 120)
 OPTION(osd_mon_report_interval_min, OPT_INT, 5)  // pg stats, failures, up_thru, boot.
index 55f11707189b13ff286dad09d077c447db59711f..1ad1949ac47f713a20b8d41f982761aa19fa1e54 100644 (file)
@@ -3513,7 +3513,7 @@ bool OSD::_is_healthy()
        ++up;
       ++num;
     }
-    if (up < num / 3) {
+    if ((float)up < (float)num * g_conf->osd_heartbeat_min_healthy_ratio) {
       dout(1) << "is_healthy false -- only " << up << "/" << num << " up peers (less than 1/3)" << dendl;
       return false;
     }