-
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
ingester.max-chunk-age #1558
ingester.max-chunk-age #1558
Conversation
@@ -246,7 +246,10 @@ func (i *Ingester) shouldFlushChunk(chunk *chunkDesc) bool { | |||
} | |||
|
|||
if time.Since(chunk.lastUpdated) > i.cfg.MaxChunkIdle { | |||
chunk.closed = true |
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.
This was removed from shouldFlushChunk
for a few reasons:
- It's only previous reference,
collectChunksToFlush
, was immediately followed by duplicate closing code: https://github.com/grafana/loki/blob/2179ed1018133b54ad7f018fff5f57e9699b9655/pkg/ingester/flush.go#L230-L232 - It's now used by
sweepStream
to support deduplicating logic and this new location should not alter thechunk.closed
field shouldFlushChunk
doesn't sound like it should mutate the underlying*chunkDesc
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.
Looks good @owen-d , you'll need to rebase on master and fix your helm chart versions for loki and loki-stack, as well as probably figure out something to do different with your changelog entry.
Otherwise lets get this merged!
5b52e66
to
bbf6694
Compare
What this PR does / why we need it:
Introduces
ingester.max-chunk-age
which specifies the maximum chunk age before it's cut. This allows us to enforce absolute time bounds on chunks, not just idle timeouts.First half of #1550