]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/fifo: Catch two instances journaling a new part
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 13 Oct 2020 21:05:58 +0000 (17:05 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 14 Oct 2020 20:18:38 +0000 (16:18 -0400)
If we see another part journaled, just run the journal ourselves.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/cls_fifo_legacy.cc

index 9741e4c5cfe81d1b4356d9190fde2ca5c0c5ce75..c55888f9e4db73e9d7f8dfddbdbe0f851ba04819 100644 (file)
@@ -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;