From: Sage Weil Date: Tue, 9 Jul 2013 18:09:44 +0000 (-0700) Subject: mon/PaxosService: pass trim target into encode_trim() X-Git-Tag: v0.67-rc1~134^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=886b637b64d7418532eedbcbba1e9f5211bcdd0f;p=ceph.git mon/PaxosService: pass trim target into encode_trim() This will help us in a few patches... Signed-off-by: Sage Weil --- diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index 9f4a3f690cb..44cb64d9adb 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -342,18 +342,17 @@ void PaxosService::maybe_trim() dout(10) << __func__ << " trimming" << dendl; MonitorDBStore::Transaction t; - encode_trim(&t); + encode_trim(&t, get_trim_to()); bufferlist bl; t.encode(bl); paxos->propose_new_value(bl, new C_Committed(this)); } -void PaxosService::encode_trim(MonitorDBStore::Transaction *t) +void PaxosService::encode_trim(MonitorDBStore::Transaction *t, version_t trim_to) { version_t first_committed = get_first_committed(); version_t latest_full = get_version_latest_full(); - version_t trim_to = get_trim_to(); dout(10) << __func__ << " " << trim_to << " (was " << first_committed << ")" << ", latest full " << latest_full << dendl; diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index ae15f049115..8b11860b3f2 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -671,12 +671,10 @@ public: * Will call encode_trim_extra(), allowing services to add * additional bits to the trim transaction. * + * @param txn the transaction to encode to * @param first The version that should become the first one in the log. - * @param force Optional. Each service may use it as it sees fit, but the - * expected behavior is that, when 'true', we will remove all - * the log versions even if we don't have a full map in store. */ - void encode_trim(MonitorDBStore::Transaction *t); + void encode_trim(MonitorDBStore::Transaction *t, version_t first); /** * encode service-specific extra bits into trim transaction