-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-expire old items from FIFO cache #5148
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
You should add a changelog entry.
3fa4ff5
to
cf120f0
Compare
@cyriltovena I've moved the ticker creation into the goroutine. Do you want to have another look? |
Let's wait for @KMiller-Grafana and I'll merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! LGTM modulo pending suggestions from Cyril.
Very nice! thanks for adding this @chaudum! |
b1690b5
to
f13e556
Compare
Hey @KMiller-Grafana, could I get a review of the (small) docs changes I did on this PR so we can merge it? |
f13e556
to
7f00665
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small change suggestions.
We can remove the validity setting of 1h in 2.4 for the chunks cache because it doesn't reduce memory usage and instead leads to valid chunks being ignore when querying the cache. Chunks are immutable so it doesn't make sense to not return them if they are present in the cache. Closes #4922 Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
As described in #4921 this PR adds a periodic task that prunes expired items from the FIFO cache to free up memory. Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
b2751bd
to
891229c
Compare
As grafana#5148 changed, the deprecated is fifocache.duration, not fifocache.interval.
As grafana#5148 changed, the deprecated is fifocache.duration, not fifocache.interval.
…ed (#7609) **What this PR does / why we need it**: I configured fifo cache with `validity` option (which is [deprecated](https://github.com/grafana/loki/blob/b92f113cb0961b628b643f4f3f9fddc1c18ed921/docs/sources/configuration/_index.md?plain=1#L2004) in v2.6.0, `fifocache.duration` as an flag) and loki print that: ``` level=warn ts=2022-07-08T17:01:30.134251284Z caller=fifo_cache.go:125 msg="running with DEPRECATED flag fifocache.interval, use fifocache.ttl instead" cache=frontend.fifocache ``` However, there is no flag `fifocache.interval`. As #5148 changed, the deprecated flag should be `fifocache.duration`, not `fifocache.interval`.
…ed (grafana#7609) **What this PR does / why we need it**: I configured fifo cache with `validity` option (which is [deprecated](https://github.com/grafana/loki/blob/b92f113cb0961b628b643f4f3f9fddc1c18ed921/docs/sources/configuration/_index.md?plain=1#L2004) in v2.6.0, `fifocache.duration` as an flag) and loki print that: ``` level=warn ts=2022-07-08T17:01:30.134251284Z caller=fifo_cache.go:125 msg="running with DEPRECATED flag fifocache.interval, use fifocache.ttl instead" cache=frontend.fifocache ``` However, there is no flag `fifocache.interval`. As grafana#5148 changed, the deprecated flag should be `fifocache.duration`, not `fifocache.interval`.
…ed (grafana#7609) **What this PR does / why we need it**: I configured fifo cache with `validity` option (which is [deprecated](https://github.com/grafana/loki/blob/b92f113cb0961b628b643f4f3f9fddc1c18ed921/docs/sources/configuration/_index.md?plain=1#L2004) in v2.6.0, `fifocache.duration` as an flag) and loki print that: ``` level=warn ts=2022-07-08T17:01:30.134251284Z caller=fifo_cache.go:125 msg="running with DEPRECATED flag fifocache.interval, use fifocache.ttl instead" cache=frontend.fifocache ``` However, there is no flag `fifocache.interval`. As grafana#5148 changed, the deprecated flag should be `fifocache.duration`, not `fifocache.interval`.
What this PR does / why we need it:
Addresses the problem of the FIFO cache where items become stale due to the validity setting but are never purged, as described in #4921
Which issue(s) this PR fixes:
Fixes #4921
Special notes for your reviewer:
Checklist
CHANGELOG.md
about the changes.