From 87e98d115ffb3b8db42521dcb7a7c5617e3f0bbb Mon Sep 17 00:00:00 2001 From: John Coffey Date: Thu, 8 Oct 2026 10:57:23 -0700 Subject: [PATCH 1/2] Size the collector tables for event 649 2026.10.8 added cluster.node-id-reassigned as event 649 without raising TOTAL_EVENT_COUNT, which sizes the collector's per-event level and counter tables. Collector::default() indexed past the end, the collector thread panicked at startup and the server ran on without writing a line of log or recording a metric. A unit test now holds TOTAL_EVENT_COUNT and TOTAL_METRIC_COUNT to the variant lists and the ids to the from_id/to_id round trip. --- crates/trc/src/event/enums.rs | 50 +++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/crates/trc/src/event/enums.rs b/crates/trc/src/event/enums.rs index 91bce264..fb1e3ed4 100644 --- a/crates/trc/src/event/enums.rs +++ b/crates/trc/src/event/enums.rs @@ -12,8 +12,10 @@ // auth.legacy-protocol-refused (legacy-protocols LP-6); 643 is // security.legacy-protocols-changed (LP-8); 644 to 646 are the cluster // coordinator's connection events; 647 and 648 are the audit log's -// (audit-hold-lock spec, AU-3, AU-8) -pub const TOTAL_EVENT_COUNT: usize = 649; +// (audit-hold-lock spec, AU-3, AU-8); 649 is cluster.node-id-reassigned. +// TOTAL_EVENT_COUNT sizes the collector's per-event tables, so it is one +// more than the highest id; the test below holds it to the variant list +pub const TOTAL_EVENT_COUNT: usize = 650; pub const TOTAL_METRIC_COUNT: usize = 369; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] @@ -1385,3 +1387,47 @@ pub enum Key { Version = 64, QueueName = 65, } + +#[cfg(test)] +mod tests { + use super::*; + + // inbuxa: a new event id past TOTAL_EVENT_COUNT panics the collector + // thread at startup and the server runs on without any logging + #[test] + fn event_ids_fit_the_collector_tables() { + let variants = EventType::variants(); + assert_eq!(variants.len(), TOTAL_EVENT_COUNT); + let mut ids = variants + .iter() + .map(|event| event.to_id()) + .collect::>(); + ids.sort_unstable(); + ids.dedup(); + assert_eq!(ids.len(), variants.len(), "duplicate event ids"); + assert_eq!( + ids.last().map(|id| *id as usize + 1), + Some(TOTAL_EVENT_COUNT) + ); + for event in variants { + assert_eq!(EventType::from_id(event.to_id()), Some(*event), "{event:?}"); + } + } + + #[test] + fn metric_ids_fit_the_metric_tables() { + let variants = MetricType::variants(); + assert_eq!(variants.len(), TOTAL_METRIC_COUNT); + let mut ids = variants + .iter() + .map(|metric| metric.to_id()) + .collect::>(); + ids.sort_unstable(); + ids.dedup(); + assert_eq!(ids.len(), variants.len(), "duplicate metric ids"); + assert_eq!( + ids.last().map(|id| *id as usize + 1), + Some(TOTAL_METRIC_COUNT) + ); + } +} -- 2.54.0 From 73c4e63f5610a3ba3168f3367231e901fe678f1c Mon Sep 17 00:00:00 2001 From: John Coffey Date: Thu, 8 Oct 2026 10:58:18 -0700 Subject: [PATCH 2/2] Release 2026.10.8.1 --- crates/types/src/branding.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/types/src/branding.rs b/crates/types/src/branding.rs index 04091488..7b20805a 100644 --- a/crates/types/src/branding.rs +++ b/crates/types/src/branding.rs @@ -81,7 +81,7 @@ fn legacy_setting(name: &str, is_set: impl Fn(&str) -> bool) -> Option { #[macro_export] macro_rules! brand_version { () => { - "2026.10.8" + "2026.10.8.1" }; } -- 2.54.0