Skip to content

Commit 5da6e28

Browse files
committed
storage: add more log context to consume_records
This `ERROR` log line is more helpful with added information about the batch consumer type and record batch header.
1 parent 3779e33 commit 5da6e28

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/v/storage/parser.cc

+9-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using stop_parser = batch_consumer::stop_parser;
4040
static ss::future<result<iobuf>> verify_read_iobuf(
4141
ss::input_stream<char>& in,
4242
size_t expected,
43-
const char* msg,
43+
std::string_view msg,
4444
bool recover = false) {
4545
auto b = co_await read_iobuf_exactly(in, expected);
4646

@@ -203,7 +203,14 @@ void continuous_batch_parser::add_bytes_and_reset() {
203203
ss::future<result<stop_parser>> continuous_batch_parser::consume_records() {
204204
auto sz = _header->size_bytes - model::packed_record_batch_header_size;
205205
return verify_read_iobuf(
206-
get_stream(), sz, "parser::consume_records", _recovery)
206+
get_stream(),
207+
sz,
208+
fmt::format(
209+
"parser::consume_records (record_batch_header: {}, batch "
210+
"consumer: {}) ",
211+
*_header,
212+
*_consumer),
213+
_recovery)
207214
.then([this](result<iobuf> record) -> ss::future<result<stop_parser>> {
208215
if (!record) {
209216
return ss::make_ready_future<result<stop_parser>>(record.error());

0 commit comments

Comments
 (0)