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

Metrics Generator: Max limit on number of failed flushes #4254

Merged
merged 4 commits into from
Oct 31, 2024

Conversation

joe-elliott
Copy link
Member

What this PR does:
Institutes a very generous limit of 100 on failed flush attempts as well as a metric to help track this. This prevents constant retries on blocks that cannot be flushed due to corruption.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Copy link
Contributor

@javiermolinar javiermolinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

go func() {
time.Sleep(delay)
if _, err := p.flushqueue.Enqueue(op); err != nil {
_ = level.Error(p.logger).Log("msg", "failed to requeue block for flushing", "err", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we fail to requeue? Should we delete the block as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think no. the only time enqueue can fail is if the queue is stopped:

https://github.com/grafana/tempo/blob/main/pkg/flushqueues/priority_queue.go#L91-L93

in this case the process is shutting down and so we want to keep the block for when it starts back up. we could definitely be more explicit about this tho.

modules/generator/processor/localblocks/processor.go Outdated Show resolved Hide resolved
Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott joe-elliott merged commit d035888 into grafana:main Oct 31, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants