From ba21da2e02f800fdfd90b11a4199aca1192829fc Mon Sep 17 00:00:00 2001 From: Yaniv Michael Kaul Date: Mon, 6 Apr 2026 14:27:18 +0300 Subject: [PATCH] compaction: set_skip_when_empty() for validation_errors metric Add .set_skip_when_empty() to compaction_manager::validation_errors. This metric only increments when scrubbing encounters out-of-order or invalid mutation fragments in SSTables, indicating data corruption. It is almost always zero and creates unnecessary reporting overhead. AI-Assisted: yes Signed-off-by: Yaniv Kaul --- compaction/compaction_manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compaction/compaction_manager.cc b/compaction/compaction_manager.cc index 8149fc1e44..5ff0b06977 100644 --- a/compaction/compaction_manager.cc +++ b/compaction/compaction_manager.cc @@ -1110,7 +1110,7 @@ void compaction_manager::register_metrics() { sm::make_gauge("normalized_backlog", [this] { return _last_backlog / available_memory(); }, sm::description("Holds the sum of normalized compaction backlog for all tables in the system. Backlog is normalized by dividing backlog by shard's available memory.")), sm::make_counter("validation_errors", [this] { return _validation_errors; }, - sm::description("Holds the number of encountered validation errors.")), + sm::description("Holds the number of encountered validation errors.")).set_skip_when_empty(), }); }