]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PaxosService: pass trim target into encode_trim()
authorSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 18:09:44 +0000 (11:09 -0700)
committerSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 18:09:44 +0000 (11:09 -0700)
This will help us in a few patches...

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

index 9f4a3f690cbe3309dfd4847d5c3b6f1cdfac05ac..44cb64d9adbcc6d0274b68bac1338fb9c4241d5a 100644 (file)
@@ -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;
index ae15f049115d8533b699f0c053b1eb5e95586e7e..8b11860b3f2b3ff5ec95eebaa792aa9c38e8e003 100644 (file)
@@ -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