Skip to content

Commit e8f7978

Browse files
authored
Merge pull request #29356 from WillemKauf/log_info_collector_debug_log
[CORE-15335] `ct/l1`: don't log on benign `missing_ntp` errors in `log_info_collector`
2 parents 8ad2683 + 85b27aa commit e8f7978

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/v/cloud_topics/level_one/compaction/log_info_collector.cc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,22 @@ void log_info_collector::populate_log_infos(
283283
auto& compaction_info = it->second;
284284

285285
if (!compaction_info.has_value()) {
286-
vlog(
287-
compaction_log.warn,
286+
// Minimize logging on benign `missing_ntp` errors in case
287+
// the `metastore` does not yet have any reconciled data for the log
288+
// in question.
289+
auto err = compaction_info.error();
290+
auto lvl = err == metastore::errc::missing_ntp
291+
&& !log.has_seen_reconciled_data
292+
? ss::log_level::debug
293+
: ss::log_level::warn;
294+
295+
vlogl(
296+
compaction_log,
297+
lvl,
288298
"Failed to collect compaction info for CTP {} during compaction: "
289299
"{}",
290300
log.ntp,
291-
compaction_info.error());
301+
err);
292302
continue;
293303
}
294304

@@ -301,6 +311,7 @@ void log_info_collector::populate_log_infos(
301311

302312
auto max_compactible_offset = offset_it->second;
303313

314+
log.has_seen_reconciled_data = true;
304315
log.info_and_ts = compaction_info_and_timestamp{
305316
.info = std::move(compaction_info).value(),
306317
.collected_at = collection_timestamp,

src/v/cloud_topics/level_one/compaction/meta.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ struct log_compaction_meta {
5454
// inflight compaction. Guaranteed to have a value if `state == inflight`.
5555
std::optional<ss::shard_id> inflight_shard{std::nullopt};
5656
intrusive_list_hook link;
57+
// If `true`, we have been able to sample compaction info from the
58+
// `metastore` previously.
59+
bool has_seen_reconciled_data{false};
5760
};
5861

5962
using log_compaction_meta_ptr = ss::lw_shared_ptr<log_compaction_meta>;

0 commit comments

Comments
 (0)