diff options
author | Gregory Farnum <greg@inktank.com> | 2013-04-22 15:22:04 -0700 |
---|---|---|
committer | Gregory Farnum <greg@inktank.com> | 2013-04-22 15:22:04 -0700 |
commit | 25019803507114e8ab2082d2c44af6588e5aafc2 (patch) | |
tree | a2338f1401535c352662344848631d11b928c07f | |
parent | 5792be81add9041e3af2c9b27a939a4e2e7d378a (diff) | |
parent | b33fae4ea17f459ca545b37bab3abedaed2cb6b8 (diff) | |
download | ceph-25019803507114e8ab2082d2c44af6588e5aafc2.tar.gz |
Merge pull request #234 from ceph/wip-4758
Fixes #4758.
Reviewed-by: Greg Farnum <greg@inktank.com>
-rw-r--r-- | src/common/config_opts.h | 1 | ||||
-rw-r--r-- | src/mon/LogMonitor.h | 5 | ||||
-rw-r--r-- | src/mon/PaxosService.cc | 4 | ||||
-rw-r--r-- | src/mon/PaxosService.h | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 7b915f2dcc4..cde016c67e7 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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 diff --git a/src/mon/LogMonitor.h b/src/mon/LogMonitor.h index 6f1c4469f26..9eee758d47f 100644 --- a/src/mon/LogMonitor.h +++ b/src/mon/LogMonitor.h @@ -49,6 +49,11 @@ private: bool should_propose(double& delay); + bool should_stash_full() { + // commit a LogSummary on every commit + return true; + } + struct C_Log : public Context { LogMonitor *logmon; MLog *ack; diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index 44d53c20723..dc5c7d6afee 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -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() diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index b4232ca3667..196a625594c 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -663,7 +663,7 @@ public: * @defgroup PaxosService_h_Stash_Full * @{ */ - bool should_stash_full(); + virtual bool should_stash_full(); /** * Encode a full version on @p t * |