From: Igor Fedotov Date: Wed, 18 Aug 2021 10:39:02 +0000 (+0300) Subject: os/bluestore: accept undecodable multi-block bluefs transactions on log X-Git-Tag: v15.2.15~19^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F43024%2Fhead;p=ceph.git os/bluestore: accept undecodable multi-block bluefs transactions on log 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 (cherry picked from commit 2ba5cb7865c2a7452ee2abda5e0986ce9c42f4b9) Conflicts: src/os/bluestore/BlueFS.cc (trivial) --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index bc6d34012bcb..6243b7594a6c 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -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