Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v22.2.x] storage: assert out on EIO in read #7702

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/v/storage/log_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,23 @@ log_segment_batch_reader::read_some(model::timeout_clock::time_point timeout) {
_iterator = co_await initialize(timeout, cache_read.next_cached_batch);
}
auto ptr = _iterator.get();
co_return co_await ptr->consume().then(
[this](result<size_t> bytes_consumed) -> result<records_t> {
co_return co_await ptr->consume()
.then([this](result<size_t> bytes_consumed) -> result<records_t> {
if (!bytes_consumed) {
return bytes_consumed.error();
}
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