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: v16.2.11~334^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=43f411ee296bdef4a9cc3c27a9f46aae4aa818f1;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 1be70934fd24..b005d8bad099 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -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); diff --git a/src/mds/OpenFileTable.cc b/src/mds/OpenFileTable.cc index aa65a27d5675..6b0e9d16337b 100644 --- a/src/mds/OpenFileTable.cc +++ b/src/mds/OpenFileTable.cc @@ -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++; diff --git a/src/mds/OpenFileTable.h b/src/mds/OpenFileTable.h index 058055575e48..bfe7e098fed1 100644 --- a/src/mds/OpenFileTable.h +++ b/src/mds/OpenFileTable.h @@ -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);