mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
Automatically set daily and hourly series limits to `MaxInt32` when `remoteWrite.maxHourlySeries` or `remoteWrite.maxDailySeries` is set to `-1`. This change addresses a usability issue with the cardinality limiter. Users may want to enable the limiter to observe its metrics before deciding on an appropriate limit. However, the underlying bloom filter only supports `int32`, so setting large values can lead to overflow. With this PR: * Setting either flag to `-1` is treated as “no practical limit” and internally mapped to `math.MaxInt32` * Values exceeding `int32` are safely clamped to `MaxInt32` to prevent overflow This allows users to enable the limiter for estimation purposes without risking invalid configurations or runtime issues. https://github.com/VictoriaMetrics/VictoriaMetrics/pull/9614 Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com> Signed-off-by: Max Kotliar <kotlyar.maksim@gmail.com> Co-authored-by: Nikolay <nik@victoriametrics.com> Co-authored-by: Max Kotliar <mkotlyar@victoriametrics.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>