Skip to content
Closed
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
32 changes: 32 additions & 0 deletions src/v/cluster/partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,20 @@ partition::timequery(storage::timequery_config cfg) {
&& cfg.min_offset < kafka::offset_cast(
_cloud_storage_partition->next_kafka_offset());

vlog(
clusterlog.debug,
"[{}] timequery: cfg={{min={}, max={}, time={}}}, "
"may_read_from_cloud={}, may_answer_from_cloud={}, "
"start_timestamp={}, raft_start_offset={}",
_raft->ntp(),
cfg.min_offset,
cfg.max_offset,
cfg.time,
may_read_from_cloud(),
may_answer_from_cloud,
_raft->log()->start_timestamp(),
_raft->start_offset());

if (_raft->log()->start_timestamp() <= cfg.time) {
// The query is ahead of the local data's start_timestamp: this
// means it _might_ hit on local data: start_timestamp is not
Expand All @@ -625,6 +639,15 @@ partition::timequery(storage::timequery_config cfg) {
// If the min_offset is ahead of max_offset, the local log is empty
// or was truncated since the timequery_config was created.
if (local_query_cfg.min_offset > local_query_cfg.max_offset) {
vlog(
clusterlog.debug,
"[{}] timequery: early return (nullopt) - "
"adjusted_min={} > max={}, raft_start_offset={} (kafka={})",
_raft->ntp(),
local_query_cfg.min_offset,
local_query_cfg.max_offset,
_raft->start_offset(),
log()->from_log_offset(_raft->start_offset()));
co_return std::nullopt;
}

Expand Down Expand Up @@ -655,6 +678,15 @@ partition::timequery(storage::timequery_config cfg) {
// If the min_offset is ahead of max_offset, the local log is empty
// or was truncated since the timequery_config was created.
if (local_query_cfg.min_offset > local_query_cfg.max_offset) {
vlog(
clusterlog.debug,
"[{}] timequery: early return (nullopt) - "
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm mind squashing these? not sure if we have a policy for this, but it seems undesirable to leave them in (e.g. they'll be in git history which is kind of distracting when code spelunking)

"adjusted_min={} > max={}, raft_start_offset={} (kafka={})",
_raft->ntp(),
local_query_cfg.min_offset,
local_query_cfg.max_offset,
_raft->start_offset(),
log()->from_log_offset(_raft->start_offset()));
co_return std::nullopt;
}

Expand Down