]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDLog: use committed seq instead of committing seq
authorXiubo Li <xiubli@redhat.com>
Thu, 24 Feb 2022 07:56:54 +0000 (15:56 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 3 Aug 2022 08:07:55 +0000 (16:07 +0800)
Since commit 9242ce90130 it won't allow multiple open file table
commits to be submit and will be worked sequentially. So whenever
is_any_committing() is false the committing seq will always equal
to committed seq.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit fb2477b29721a87a5f5f3c0b8a687ccbccf2b9c8)

src/mds/MDLog.cc
src/mds/OpenFileTable.cc
src/mds/OpenFileTable.h

index b5fcf043dcb9b4b8d7a666b354b43fa47416f43f..15502868a60e30c2a2ec44cfc13dc57c83c75b11 100644 (file)
@@ -732,7 +732,7 @@ int MDLog::trim_all()
     last_seq = get_last_segment_seq();
     if (!capped &&
        !mds->mdcache->open_file_table.is_any_committing() &&
-       last_seq > mds->mdcache->open_file_table.get_committing_log_seq()) {
+       last_seq > mds->mdcache->open_file_table.get_committed_log_seq()) {
       submit_mutex.unlock();
       mds->mdcache->open_file_table.commit(new C_OFT_Committed(this, last_seq),
                                           last_seq, CEPH_MSG_PRIO_DEFAULT);
index 1d52e4b99239abfca68925f37249e20a75ed0db9..eea7c0409c523cc50764e0190d580c5b3e757b53 100644 (file)
@@ -271,13 +271,14 @@ public:
 
 void OpenFileTable::_commit_finish(int r, uint64_t log_seq, MDSContext *fin)
 {
-  dout(10) << __func__ << " log_seq " << log_seq << dendl;
+  dout(10) << __func__ << " log_seq " << log_seq << " committed_log_seq " << committed_log_seq
+           << " committing_log_seq " << committing_log_seq << dendl;
   if (r < 0) {
     mds->handle_write_error(r);
     return;
   }
 
-  ceph_assert(log_seq <= committing_log_seq);
+  ceph_assert(log_seq == committing_log_seq);
   ceph_assert(log_seq >= committed_log_seq);
   committed_log_seq = log_seq;
   num_pending_commit--;
@@ -336,7 +337,8 @@ void OpenFileTable::_journal_finish(int r, uint64_t log_seq, MDSContext *c,
 
 void OpenFileTable::commit(MDSContext *c, uint64_t log_seq, int op_prio)
 {
-  dout(10) << __func__ << " log_seq " << log_seq << dendl;
+  dout(10) << __func__ << " log_seq " << log_seq << " committing_log_seq:"
+          << committing_log_seq << dendl;
 
   ceph_assert(num_pending_commit == 0);
   num_pending_commit++;
index d3934f753b4fefa8097f1f172e8c51de3d8f4c26..1f91c202021f9ad8d3ee5c11a0c9459e48fe48d3 100644 (file)
@@ -42,7 +42,6 @@ public:
 
   void commit(MDSContext *c, uint64_t log_seq, int op_prio);
   uint64_t get_committed_log_seq() const { return committed_log_seq; }
-  uint64_t get_committing_log_seq() const { return committing_log_seq; }
   bool is_any_committing() const { return num_pending_commit > 0; }
 
   void load(MDSContext *c);