]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: accept undecodable multi-block bluefs transactions on log 43024/head
authorIgor Fedotov <ifedotov@suse.com>
Wed, 18 Aug 2021 10:39:02 +0000 (13:39 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Thu, 2 Sep 2021 09:56:02 +0000 (12:56 +0300)
replay.

We should proceed with OSD startup when detecting undecodable bluefs
transaction spanning multiple disk blocks during log replay.
The rationale is that such a transaction might appear during unexpected
power down - just not every disk block is written to disk. Hence we can
consider this a normal log replay stop condition.

https://tracker.ceph.com/issues/52079

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit 2ba5cb7865c2a7452ee2abda5e0986ce9c42f4b9)

 Conflicts:
src/os/bluestore/BlueFS.cc (trivial)

src/os/bluestore/BlueFS.cc

index bc6d34012bcbf4aa71791824925df19fb0ffdf1e..6243b7594a6c8b2fa734c59b1b5884d5e5a46276 100644 (file)
@@ -1224,18 +1224,27 @@ int BlueFS::_replay(bool noop, bool to_stdout)
       bl.claim_append(t);
       read_pos += r;
     }
-    seen_recs = true;
     bluefs_transaction_t t;
     try {
       auto p = bl.cbegin();
       decode(t, p);
-    }
-    catch (buffer::error& e) {
-      derr << __func__ << " 0x" << std::hex << pos << std::dec
-           << ": stop: failed to decode: " << e.what()
-           << dendl;
-      delete log_reader;
-      return -EIO;
+      seen_recs = true;
+    }
+    catch (ceph::buffer::error& e) {
+      // Multi-block transactions might be incomplete due to unexpected
+      // power off. Hence let's treat that as a regular stop condition.
+      if (seen_recs && more) {
+        dout(10) << __func__ << " 0x" << std::hex << pos << std::dec
+                 << ": stop: failed to decode: " << e.what()
+                 << dendl;
+      } else {
+        derr << __func__ << " 0x" << std::hex << pos << std::dec
+             << ": stop: failed to decode: " << e.what()
+             << dendl;
+        delete log_reader;
+        return -EIO;
+      }
+      break;
     }
     ceph_assert(seq == t.seq);
     dout(10) << __func__ << " 0x" << std::hex << pos << std::dec