Skip to content

Commit

Permalink
storage: assert out on EIO in read
Browse files Browse the repository at this point in the history
(cherry picked from commit 875faa4)
  • Loading branch information
jcsp committed Dec 12, 2022
1 parent b69df77 commit a4baf73
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/v/storage/log_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,16 @@ log_segment_batch_reader::read_some(model::timeout_clock::time_point timeout) {
}
auto tmp = std::exchange(_state, {});
return result<records_t>(std::move(tmp.buffer));
});
})
.handle_exception_type(
[](const std::system_error& ec) -> ss::future<result<records_t>> {
if (ec.code().value() == EIO) {
vassert(false, "I/O error during read! Disk failure?");
} else {
return ss::make_exception_future<result<records_t>>(
std::current_exception());
}
});
}

log_reader::log_reader(
Expand Down

0 comments on commit a4baf73

Please sign in to comment.