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)
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