Skip to content

prevent active-series underflow in local series limiter - #6568

Merged
carles-grafana merged 2 commits into
grafana:mainfrom
carles-grafana:underflow
Mar 2, 2026
Merged

prevent active-series underflow in local series limiter#6568
carles-grafana merged 2 commits into
grafana:mainfrom
carles-grafana:underflow

Conversation

@carles-grafana

@carles-grafana carles-grafana commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

tempo_metrics_generator_registry_active_series could wrap due to uint32 underflow
when stale cleanup deletes overflow series that were never counted as active.

  • ignore OnDelete for overflow entity hash
  • clamp delete count to current active-series value before subtracting
  • add regression test for accepted+overflow stale-delete sequence

What this PR does:

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
@knylander-grafana

Copy link
Copy Markdown
Contributor

Do we need a changelog entry for this?

Comment thread modules/generator/localserieslimiter/local_series_limiter.go
  `tempo_metrics_generator_registry_active_series` could wrap due to uint32 underflow
  when stale cleanup deletes overflow series that were never counted as active.

  - ignore `OnDelete` for overflow entity hash
  - clamp delete count to current active-series value before subtracting
  - add regression test for accepted+overflow stale-delete sequence
@carles-grafana
carles-grafana merged commit acfb58b into grafana:main Mar 2, 2026
24 checks passed
mattdurham pushed a commit to mattdurham/tempo that referenced this pull request Jun 18, 2026
* prevent active-series underflow in local series limiter

  `tempo_metrics_generator_registry_active_series` could wrap due to uint32 underflow
  when stale cleanup deletes overflow series that were never counted as active.

  - ignore `OnDelete` for overflow entity hash
  - clamp delete count to current active-series value before subtracting
  - add regression test for accepted+overflow stale-delete sequence

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants