[ING-483] misc(cache): Stop eager charge cache expiration - #5977
Merged
Merged
Conversation
vincent-pochet
force-pushed
the
misc-lazy-cache
branch
2 times, most recently
from
July 21, 2026 07:32
54f28be to
e5cb2a7
Compare
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — Remove |
vincent-pochet
force-pushed
the
misc-lazy-cache
branch
from
September 11, 2026 15:47
e5cb2a7 to
5e9ca64
Compare
## Context The charge usage cache used to be expired eagerly, from the event post-processing path, on every event reception. Lazy validation, gated behind the `lazy_charge_usage_cache` feature flag, replaced it: the cache entry carries the watermark of what it aggregated and is rejected at read time when a newer event exists. ## Description Remove the eager expiration and stop reading the feature flag that selected between the two strategies, so lazy validation is the only behaviour. The cache key version is now `2` for every organization, which drops the entries written under the legacy shape instead of reading them back with the wrong value shape. Full usage entries and the ingestion timestamps that feed them are no longer conditioned on the flag either: they now depend only on the granular lifetime usage integration and on the request being describable by the cache key. The flag itself is kept declared for now, and will be retired in a follow-up once no organization carries it any more. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vincent-pochet
force-pushed
the
misc-lazy-cache
branch
from
September 11, 2026 15:55
5e9ca64 to
16794d0
Compare
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: PASS · CI green PASS — Lazy charge-cache validation is consistently enabled across cache keys, readers, and full-usage caching. Explicit invalidation remains for usage-removal paths, and the specs cover wrapped-cache invalidation and full-usage caching without the feature flag. |
toommz
approved these changes
Sep 14, 2026
vincent-pochet
added a commit
that referenced
this pull request
Sep 14, 2026
> Follow-up of #5977, which removed the last reader of the flag. ## Context Nothing reads the `lazy_charge_usage_cache` feature flag anymore: lazy validation of the charge usage cache is now unconditional, and the eager expiration path it used to gate is gone. Unlike the other flags removed recently, this one was enabled on real organizations, so the value still sits in their `organizations.feature_flags`. ## Description - Remove the `lazy_charge_usage_cache` flag definition. - Regenerate the GraphQL schema dumps, since `FeatureFlagEnum` is built from the flag definitions. A stale value is harmless — `feature_flag_enabled?` is never called with it and the GraphQL type filters out unknown flags — but `FeatureFlag.sanitize!` can be run after deploy to clear it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Context
Related to #5959 & getlago/lago#766
Decription
This PR removes the charge cache invalidation logic from the events-processor, as we are now relying on a lazy invalidation approach.