Skip to content
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

Merged
merged 5 commits into from
Jan 23, 2020
Merged

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Jan 21, 2020

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

@@ -246,7 +246,10 @@ func (i *Ingester) shouldFlushChunk(chunk *chunkDesc) bool {
}

if time.Since(chunk.lastUpdated) > i.cfg.MaxChunkIdle {
chunk.closed = true
Copy link
Member Author

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:

  1. 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
  2. It's now used by sweepStream to support deduplicating logic and this new location should not alter the chunk.closed field
  3. shouldFlushChunk doesn't sound like it should mutate the underlying *chunkDesc

@owen-d owen-d requested a review from slim-bean January 22, 2020 21:01
Copy link
Collaborator

@slim-bean slim-bean left a 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!

@cyriltovena cyriltovena self-assigned this Jan 23, 2020
@owen-d owen-d force-pushed the feature/ingester-max-chunk-age branch from 5b52e66 to bbf6694 Compare January 23, 2020 13:53
@slim-bean slim-bean merged commit 5026dfe into grafana:master Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants