]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/JournalingObjectStore: applied_seq -> max_applied_seq
authorSage Weil <sage@inktank.com>
Sun, 2 Dec 2012 15:31:49 +0000 (07:31 -0800)
committerSage Weil <sage@inktank.com>
Sun, 2 Dec 2012 22:30:33 +0000 (14:30 -0800)
Rename applied_seq to max_applied_seq, since it is a bound; there may be
seq's < max_applied_seq that are not applied.  This aligns the naming with
max_applying_seq.

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

index 3f05fa0fb167a36e8e735640eafc705bdb882b50..b1aee62eca8cf379aa3caf2a154bb0e2e9c7f75d 100644 (file)
@@ -142,7 +142,7 @@ void JournalingObjectStore::ApplyManager::op_apply_finish(uint64_t op)
   dout(10) << "op_apply_finish " << op << " open_ops " << open_ops
           << " -> " << (open_ops-1)
           << ", max_applying_seq " << max_applying_seq
-          << ", applied_seq " << applied_seq << " -> " << MAX(op, applied_seq)
+          << ", max_applied_seq " << max_applied_seq << " -> " << MAX(op, max_applied_seq)
           << dendl;
   if (--open_ops == 0)
     open_ops_cond.Signal();
@@ -150,8 +150,8 @@ void JournalingObjectStore::ApplyManager::op_apply_finish(uint64_t op)
   // there can be multiple applies in flight; track the max value we
   // note.  note that we can't _read_ this value and learn anything
   // meaningful unless/until we've quiesced all in-flight applies.
-  if (op > applied_seq)
-    applied_seq = op;
+  if (op > max_applied_seq)
+    max_applied_seq = op;
 }
 
 uint64_t JournalingObjectStore::SubmitManager::op_submit_start()
@@ -193,20 +193,20 @@ bool JournalingObjectStore::ApplyManager::commit_start()
   {
     Mutex::Locker l(apply_lock);
     dout(10) << "commit_start max_applying_seq " << max_applying_seq
-            << ", applied_seq " << applied_seq
+            << ", max_applied_seq " << max_applied_seq
             << dendl;
     blocked = true;
     while (open_ops > 0) {
       dout(10) << "commit_start blocked, waiting for " << open_ops << " open ops, "
-              << " max_applying_seq " << max_applying_seq << " applied_seq " << applied_seq << dendl;
+              << " max_applying_seq " << max_applying_seq << " max_applied_seq " << max_applied_seq << dendl;
       open_ops_cond.Wait(apply_lock);
     }
     assert(open_ops == 0);
-    assert(applied_seq == max_applying_seq);
+    assert(max_applied_seq == max_applying_seq);
     dout(10) << "commit_start blocked, all open_ops have completed" << dendl;
     {
       Mutex::Locker l(com_lock);
-      if (applied_seq == committed_seq) {
+      if (max_applied_seq == committed_seq) {
        dout(10) << "commit_start nothing to do" << dendl;
        blocked = false;
        if (!ops_apply_blocked.empty())
index 28665799a8c61cd378a00951a1f4f69fb9d9c8c1..ae74c32cd25f3ac7132f84cb332de191408d876c 100644 (file)
@@ -55,7 +55,7 @@ protected:
     int open_ops;
     Cond open_ops_cond;
     uint64_t max_applying_seq;
-    uint64_t applied_seq;
+    uint64_t max_applied_seq;
 
     Mutex com_lock;
     map<version_t, vector<Context*> > commit_waiters;
@@ -70,7 +70,7 @@ protected:
       blocked(false),
       open_ops(0),
       max_applying_seq(0),
-      applied_seq(0),
+      max_applied_seq(0),
       com_lock("JOS::ApplyManager::com_lock", false, true, false, g_ceph_context),
       committing_seq(0), committed_seq(0) {}
     void add_waiter(uint64_t, Context*);
@@ -99,7 +99,7 @@ protected:
       }
       {
        Mutex::Locker l(apply_lock);
-       max_applying_seq = applied_seq = fs_op_seq;
+       max_applying_seq = max_applied_seq = fs_op_seq;
       }
     }
   } apply_manager;