]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: set threshold to periodically stash_full
authorSage Weil <sage@inktank.com>
Mon, 22 Apr 2013 21:58:09 +0000 (14:58 -0700)
committerSage Weil <sage@inktank.com>
Mon, 22 Apr 2013 22:12:22 +0000 (15:12 -0700)
Set an interval to periodically write a full copy of the map that is lower
than the trim point (which is generally a very large number of commits).

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

index 7b915f2dcc4776d58f65e18db71d6dd7b8c6154f..cde016c67e7800b0fb53ff544f98d0fa9d4d40e2 100644 (file)
@@ -186,6 +186,7 @@ OPTION(mon_leveldb_block_size, OPT_U64, 4*1024*1024) // monitor's leveldb block
 OPTION(mon_leveldb_bloom_size, OPT_INT, 0) // monitor's leveldb bloom bits per entry
 OPTION(mon_leveldb_max_open_files, OPT_INT, 0) // monitor's leveldb max open files
 OPTION(mon_leveldb_compression, OPT_BOOL, false) // monitor's leveldb uses compression
+OPTION(paxos_stash_full_interval, OPT_INT, 25)   // how often (in commits) to stash a full copy of the PaxosService state
 OPTION(paxos_max_join_drift, OPT_INT, 10) // max paxos iterations before we must first sync the monitor stores
 OPTION(paxos_propose_interval, OPT_DOUBLE, 1.0)  // gather updates for this long before proposing a map update
 OPTION(paxos_min_wait, OPT_DOUBLE, 0.05)  // min time to gather updates for after period of inactivity
index 44d53c20723808afb860a6573d485d4610790fd1..dc5c7d6afeea903da39b39d72ca17b1e655745eb 100644 (file)
@@ -178,7 +178,9 @@ bool PaxosService::should_stash_full()
    *      nonetheless because, in that event,
    *         latest_full == get_trim_to() == 0.
    */
-  return (!latest_full || (latest_full <= get_trim_to()));
+  return (!latest_full ||
+         (latest_full <= get_trim_to()) ||
+         (get_version() - latest_full > (unsigned)g_conf->paxos_stash_full_interval));
 }
 
 void PaxosService::restart()