]> 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>
Tue, 30 Aug 2022 02:43:01 +0000 (10:43 +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 1be70934fd2405ac89511463cb89e83390598310..b005d8bad099be1403f399cfd91d21de4f25ada3 100644 (file)
@@ -730,7 +730,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 aa65a27d5675f2e12581e5b187ec960f8a09d7d8..6b0e9d16337bd0b8ce575e2444c7a830daa3a28a 100644 (file)
@@ -268,13 +268,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--;
@@ -333,7 +334,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 058055575e4854508dd20f3642cec837de78251c..bfe7e098fed16aa0080b8c9729b55edfe581d633 100644 (file)
@@ -40,7 +40,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);