]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add an independent option for max election time 7245/head
authorSangdi Xu <xu.sangdi@h3c.com>
Fri, 15 Jan 2016 07:35:28 +0000 (15:35 +0800)
committerSangdi Xu <xu.sangdi@h3c.com>
Fri, 15 Jan 2016 11:12:46 +0000 (19:12 +0800)
add a new configure option mon_election_timeout, which is not dependent on mon_lease

Signed-off-by: Sangdi Xu <xu.sangdi@h3c.com>
PendingReleaseNotes
src/common/config_opts.h
src/mon/Elector.cc
src/mon/Monitor.cc

index 031300fec9aa53e7fd36df136844b8f07a09a9a7..66a82a5c5f819cbd2607a5a757949f55146d2900 100644 (file)
@@ -7,3 +7,7 @@ v10.0.0
 
 * The 'send_pg_creates' and 'map_pg_creates' mon CLI commands are
   obsolete and no longer supported.
+
+* A new configure option 'mon_election_timeout' is added to specifically
+  limit max waiting time of monitor election process, which was previously
+  restricted by 'mon_lease'.
index bfc0cf7c0154a26d2cf7f2b402b7f6ab39a60ffb..c7b09bf2e42107ee1422fc067d58c2b1dbe7be0e 100644 (file)
@@ -225,6 +225,7 @@ OPTION(mon_osd_prime_pg_temp, OPT_BOOL, false)  // prime osdmap with pg mapping
 OPTION(mon_osd_prime_pg_temp_max_time, OPT_FLOAT, .5)  // max time to spend priming
 OPTION(mon_osd_pool_ec_fast_read, OPT_BOOL, false) // whether turn on fast read on the pool or not
 OPTION(mon_stat_smooth_intervals, OPT_INT, 2)  // smooth stats over last N PGMap maps
+OPTION(mon_election_timeout, OPT_FLOAT, 5)  // on election proposer, max waiting time for all ACKs
 OPTION(mon_lease, OPT_FLOAT, 5)       // lease interval
 OPTION(mon_lease_renew_interval_factor, OPT_FLOAT, .6) // on leader, to renew the lease
 OPTION(mon_lease_ack_timeout_factor, OPT_FLOAT, 2.0) // on leader, if lease isn't acked by all peons
index 3bec0effa58ac01a278add6814112ce775780507..9e011e34fdd702463e5ac220a9422df2ef1e9978 100644 (file)
@@ -130,7 +130,7 @@ void Elector::reset_timer(double plus)
   // set the timer
   cancel_timer();
   expire_event = new C_ElectionExpire(this);
-  mon->timer.add_event_after(g_conf->mon_lease + plus,
+  mon->timer.add_event_after(g_conf->mon_election_timeout + plus,
                             expire_event);
 }
 
index e54e55e76e44de9a88d2db40bd8cf933ed23ee57..e557380a7d5e7e5d5ed46a03350479b0395d7c37 100644 (file)
@@ -451,6 +451,7 @@ const char** Monitor::get_tracked_conf_keys() const
 {
   static const char* KEYS[] = {
     "crushtool", // helpful for testing
+    "mon_election_timeout",
     "mon_lease",
     "mon_lease_renew_interval_factor",
     "mon_lease_ack_timeout_factor",