-
Notifications
You must be signed in to change notification settings - Fork 2.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
deltatocumulative: evict only stale streams #33015
deltatocumulative: evict only stale streams #33015
Conversation
changes eviction behavior at limit to only delete streams if they are actually stale. Current behavior just deletes the oldest, which leads to rapid deletion of all streams under heavy load, making this processor unusable.
4f85f2a
to
5c92bd3
Compare
@@ -59,5 +59,5 @@ func (m HashMap[T]) Clear() { | |||
// Evictors remove the "least important" stream based on some strategy such as | |||
// the oldest, least active, etc. | |||
type Evictor interface { | |||
Evict() identity.Stream | |||
Evict() (identity.Stream, bool) |
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.
Can you document what the returns are
// if not already tracked and no space: try to evict | ||
if !exist && m.Map.Len() >= m.Max { | ||
errl := ErrLimit(m.Max) | ||
gone, ok := m.Evictor.Evict() |
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.
for a future PR: it would be nice to have an eviction counter, if there isn't one already
I'm merging, as @sh0rez is out for a week and I think the comments from this PR can be addressed in a follow-up PR. |
**Description:** fixes broken check in eviction behavior such that it only evicts actually stale metrics. this was already attempted in #33015, but was insufficient **Testing:** tests were added
changes eviction behavior at limit to only delete streams if they are actually stale. Current behavior just deletes the oldest, which leads to rapid deletion of all streams under heavy load, making this processor unusable.
Description:
Link to tracking Issue:
Fixes #33014
Testing:
Documentation: