From: myoungwon oh Date: Fri, 6 May 2022 05:42:23 +0000 (+0900) Subject: seastore/cbjournal: use cur_segment_seq to track the sequence of written records X-Git-Tag: v18.0.0~857^2~29 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c5ebd3a704dd5d3442fff2bd94827fa95cc52aa;p=ceph.git seastore/cbjournal: use cur_segment_seq to track the sequence of written records Signed-off-by: Myoungwon Oh --- diff --git a/src/crimson/os/seastore/journal/circular_bounded_journal.cc b/src/crimson/os/seastore/journal/circular_bounded_journal.cc index fa1ef3250af5..1d3a852d6b0e 100644 --- a/src/crimson/os/seastore/journal/circular_bounded_journal.cc +++ b/src/crimson/os/seastore/journal/circular_bounded_journal.cc @@ -134,7 +134,7 @@ CircularBoundedJournal::open_for_write(rbm_abs_addr start) return open_for_write_ret( open_for_write_ertr::ready_future_marker{}, journal_seq_t{ - header.cur_segment_seq, + cur_segment_seq, paddr }); } @@ -157,7 +157,7 @@ CircularBoundedJournal::open_for_write(rbm_abs_addr start) return open_for_write_ret( open_for_write_ertr::ready_future_marker{}, journal_seq_t{ - header.cur_segment_seq, + cur_segment_seq, paddr }); }); @@ -240,7 +240,7 @@ CircularBoundedJournal::submit_record_ret CircularBoundedJournal::submit_record( } journal_seq_t j_seq { - header.cur_segment_seq++, + cur_segment_seq++, convert_abs_addr_to_paddr( get_written_to(), header.device_id)}; @@ -401,6 +401,7 @@ Journal::replay_ret CircularBoundedJournal::replay( r_header.committed_to, (seastore_off_t)bl.length() }; + cur_segment_seq = r_header.committed_to.segment_seq + 1; cursor_addr += bl.length(); set_written_to(cursor_addr); last_seq = r_header.committed_to.segment_seq; diff --git a/src/crimson/os/seastore/journal/circular_bounded_journal.h b/src/crimson/os/seastore/journal/circular_bounded_journal.h index f5f04cb1099b..c48d5a2f2a86 100644 --- a/src/crimson/os/seastore/journal/circular_bounded_journal.h +++ b/src/crimson/os/seastore/journal/circular_bounded_journal.h @@ -222,7 +222,6 @@ public: uint64_t flag = 0; // represent features (reserved) uint8_t csum_type = 0; // type of checksum algoritghm used in cbj_header_t uint64_t csum = 0; // checksum of entire cbj_header_t - uint32_t cur_segment_seq = 0; rbm_abs_addr start = 0; // start address of CircularBoundedJournal rbm_abs_addr end = 0; // start address of CircularBoundedJournal @@ -243,7 +242,6 @@ public: denc(v.flag, p); denc(v.csum_type, p); denc(v.csum, p); - denc(v.cur_segment_seq, p); denc(v.start, p); denc(v.end, p); denc(v.device_id, p); @@ -323,6 +321,7 @@ private: std::string path; WritePipeline *write_pipeline = nullptr; bool init = false; + segment_seq_t cur_segment_seq = 0; // segment seq to track the sequence to written records }; std::ostream &operator<<(std::ostream &out, const CircularBoundedJournal::cbj_header_t &header);