fix: preserve counter chain entries during backfill so snapshot captures full history#39
Merged
davidbirdsong merged 1 commit intoJun 25, 2026
Conversation
Author
|
This change is part of the following stack: Change managed by git-spice. |
991d370 to
bfc34a6
Compare
169b869 to
35db8a7
Compare
Merged
5 tasks
Author
|
spike test unit test passes now: |
35db8a7 to
2d89c11
Compare
6 tasks
shreekarshetty
approved these changes
Jun 25, 2026
Base automatically changed from
davidbirdsong/net-146-switch-cloudflare-exporter-from-pull-based-scraping-to-push-11
to
develop
June 25, 2026 15:03
…res full history Expire ran on every tick during backfill to prevent unbounded window growth, but it also evicted counter chain entries for buckets older than WindowTTL. Since backfill data spans hours and WindowTTL is 15 minutes, most backfill entries were evicted before the post-backfill snapshot could push them. Only the most recent ~15 minutes of data appeared in downstream systems. Expire now accepts an evictChains flag. During backfill it frees tracker/window memory but preserves chain entries. After the snapshot pushes, EvictStaleChains does a one-time cleanup. This also fixes spikes.
2d89c11 to
1b51321
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
Fix backfill
Expire ran on every tick during backfill to prevent unbounded window growth, but it also evicted counter chain entries for buckets older than WindowTTL. Since backfill data spans hours and WindowTTL is 15 minutes, most backfill entries were evicted before the post-backfill snapshot could push them. Only the most recent ~15 minutes of data appeared in downstream systems.
Expire now accepts an evictChains flag. During backfill it frees tracker/window memory but preserves chain entries. After the snapshot pushes, EvictStaleChains does a one-time cleanup.
Type of Change