-
Notifications
You must be signed in to change notification settings - Fork 455
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
[agg] Use timestamp (not start aligned) for expiring forward versions #3922
Conversation
The forward_writer uses a version map indexed by timestamp, which is not start aligned. When the flusher passes the set of times to expire, it needs to convert the start aligned time to a timestamp. This manifests as a significant memory leak for sparse workloads where the timestamp of N != start aligned time of N+1. In those cases the versions are never GCd when they expire out of the buffer.
@@ -3275,5 +3286,9 @@ func verifyOnForwardedFlushResult(t *testing.T, expected, actual []testOnForward | |||
require.Equal(t, len(expected), len(actual)) | |||
for i := 0; i < len(expected); i++ { | |||
require.True(t, expected[i].aggregationKey.Equal(actual[i].aggregationKey)) | |||
require.Equal(t, len(expected[i].expiredTimes), len(actual[i].expiredTimes)) |
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.
👍
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.
and forgot to mention, this assertion would have exposed the bug (tests failed without the code change).
Codecov Report
@@ Coverage Diff @@
## master #3922 +/- ##
========================================
- Coverage 56.7% 56.7% -0.1%
========================================
Files 555 555
Lines 63347 63347
========================================
- Hits 35931 35919 -12
- Misses 24218 24232 +14
+ Partials 3198 3196 -2
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
* master: [agg] Use timestamp (not start aligned) for expiring forward versions (#3922) [tests] Add support for calls to label APIs in resources.Coordinator (#3916) [tests] Convert repair_and_replication Docker Integration Test to In-process (#3903) Always Close the conn if failed to write acks (#3855) [m3msg] Add receive and handle latency to consumers (#3920)
The forward_writer uses a version map indexed by timestamp, which is not
start aligned. When the flusher passes the set of times to expire, it
needs to convert the start aligned time to a timestamp.
This manifests as a significant memory leak for sparse workloads where
the timestamp of N != start aligned time of N+1. In those cases the
versions are never GCd when they expire out of the buffer.
What this PR does / why we need it:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: