From 9a323cf8b15ebc045dfda74d43ab9486c481f32e Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Tue, 13 Oct 2020 17:05:58 -0400 Subject: [PATCH] rgw/fifo: Catch two instances journaling a new part If we see another part journaled, just run the journal ourselves. Signed-off-by: Adam C. Emerson --- src/rgw/cls_fifo_legacy.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/rgw/cls_fifo_legacy.cc b/src/rgw/cls_fifo_legacy.cc index 9741e4c5cfe..c55888f9e4d 100644 --- a/src/rgw/cls_fifo_legacy.cc +++ b/src/rgw/cls_fifo_legacy.cc @@ -668,6 +668,18 @@ int FIFO::_prepare_new_part(bool is_head, std::uint64_t tid, optional_yield y) << " entering: tid=" << tid << dendl; std::unique_lock l(m); std::vector jentries = { info.next_journal_entry(generate_tag()) }; + if (info.journal.find(jentries.front().part_num) != info.journal.end()) { + l.unlock(); + ldout(cct, 5) << __PRETTY_FUNCTION__ << ":" << __LINE__ + << " new part journaled, but not processed: tid=" + << tid << dendl; + auto r = process_journal(tid, y); + if (r < 0) { + lderr(cct) << __PRETTY_FUNCTION__ << ":" << __LINE__ + << " process_journal failed: r=" << r << " tid=" << tid << dendl; + } + return r; + } std::int64_t new_head_part_num = info.head_part_num; auto version = info.version; -- 2.39.5