Skip to content

Commit

Permalink
cloud_storage: Log config in remote partition
Browse files Browse the repository at this point in the history
At several points in remote partition such as creating a reader, waiting
for units, initializing a cursor, the config is logged. The client
address is part of this config so it should now be possible to take a
stuck connection and be able to trace its current state somewhat more
precisely than solely based on log offsets.
  • Loading branch information
abhijat committed Nov 8, 2023
1 parent 4ef98df commit ca5effa
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions src/v/cloud_storage/remote_partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,16 @@ class partition_record_batch_reader_impl final
_reader = {};
}
}

vlog(
_ctxlog.trace,
"partition_record_batch_reader_impl:: start: creating cursor: {}",
config);
co_await init_cursor(config);
vlog(
_ctxlog.trace,
"partition_record_batch_reader_impl:: start: created cursor: {}",
config);
_partition->_ts_probe.reader_created();
}

Expand Down Expand Up @@ -306,7 +315,10 @@ class partition_record_batch_reader_impl final
co_return storage_t{};
}
if (_reader->config().over_budget) {
vlog(_ctxlog.debug, "We're over-budget, stopping");
vlog(
_ctxlog.debug,
"We're over-budget, stopping, config: {}",
_reader->config());
// We need to stop in such way that will keep the
// reader in the reusable state, so we could reuse
// it on next iteration
Expand Down Expand Up @@ -557,7 +569,9 @@ class partition_record_batch_reader_impl final
segment_reader_units segment_reader_unit) {
vlog(
_ctxlog.debug,
"partition_record_batch_reader_impl initialize reader state");
"partition_record_batch_reader_impl initialize reader state, config: "
"{}",
config);
auto [reader, next_offset] = find_cached_reader(
manifest,
config,
Expand All @@ -572,7 +586,8 @@ class partition_record_batch_reader_impl final
_ctxlog.debug,
"partition_record_batch_reader_impl initialize reader state - "
"segment not "
"found");
"found, config: {}",
config);
_reader = {};
_next_segment_base_offset = {};
}
Expand Down Expand Up @@ -1086,14 +1101,23 @@ ss::future<storage::translating_reader> remote_partition::make_reader(
std::ignore = deadline;
vlog(
_ctxlog.debug,
"remote partition make_reader invoked, config: {}, num segments {}",
"remote partition make_reader invoked (waiting for units), config: {}, "
"num segments {}",
config,
_segments.size());

auto units = co_await _api.materialized().get_partition_reader_units(
config.abort_source);
auto ot_state = ss::make_lw_shared<storage::offset_translator_state>(
get_ntp());

vlog(
_ctxlog.trace,
"remote partition make_reader invoked (units acquired), config: {}, "
"num segments {}",
config,
_segments.size());

auto impl = std::make_unique<partition_record_batch_reader_impl>(
shared_from_this(), ot_state, std::move(units));
co_await impl->start(config);
Expand All @@ -1120,7 +1144,8 @@ remote_partition::timequery(storage::timequery_config cfg) {
cfg.prio,
cfg.type_filter,
cfg.time,
cfg.abort_source);
cfg.abort_source,
cfg.client_address);

// Construct a reader that will skip to the requested timestamp
// by virtue of log_reader_config::start_timestamp
Expand Down

0 comments on commit ca5effa

Please sign in to comment.