From: Xiubo Li Date: Thu, 24 Feb 2022 07:56:54 +0000 (+0800) Subject: mds/MDLog: use committed seq instead of committing seq X-Git-Tag: v17.2.4~77^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=76b93260bcf63b8c170de20593ba64646feff5ca;p=ceph.git mds/MDLog: use committed seq instead of committing seq 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 (cherry picked from commit fb2477b29721a87a5f5f3c0b8a687ccbccf2b9c8) --- diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index b5fcf043dcb9..15502868a60e 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -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); diff --git a/src/mds/OpenFileTable.cc b/src/mds/OpenFileTable.cc index 1d52e4b99239..eea7c0409c52 100644 --- a/src/mds/OpenFileTable.cc +++ b/src/mds/OpenFileTable.cc @@ -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++; diff --git a/src/mds/OpenFileTable.h b/src/mds/OpenFileTable.h index d3934f753b4f..1f91c202021f 100644 --- a/src/mds/OpenFileTable.h +++ b/src/mds/OpenFileTable.h @@ -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);