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

refactor(blooms): Implement retry in builder #13306

Merged
merged 8 commits into from
Jun 26, 2024

Conversation

salvacorts
Copy link
Contributor

@salvacorts salvacorts commented Jun 25, 2024

What this PR does / why we need it:
This PR implements a retry with backoff in the bloom builder. We retry to connect to the planner at two levels:

  • At the top of the receive and build loop
  • When we try to send back the task result to the planner

Special notes for your reviewer:

  • We do not retry when we send a builder shutdown notification to the planner. Rationale being that this more like a best effort and we don't want to prevent a builder from shutting down.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@salvacorts salvacorts changed the title Salvacorts/bloom refactor/retry in builder refactor(blooms): Implement retry in builder Jun 25, 2024
@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Jun 25, 2024
@salvacorts salvacorts marked this pull request as ready for review June 25, 2024 09:22
@salvacorts salvacorts requested a review from a team as a code owner June 25, 2024 09:22
pkg/bloombuild/builder/builder.go Outdated Show resolved Hide resolved
pkg/bloombuild/builder/builder_test.go Show resolved Hide resolved
pkg/bloombuild/builder/builder_test.go Outdated Show resolved Hide resolved
pkg/bloombuild/builder/builder_test.go Outdated Show resolved Hide resolved
pkg/bloombuild/builder/config.go Outdated Show resolved Hide resolved
@@ -149,14 +192,19 @@ func (f *fakePlannerServer) BuilderLoop(srv protos.PlannerForBuilder_BuilderLoop
if _, err := srv.Recv(); err != nil {
return fmt.Errorf("failed to receive task response: %w", err)
}
f.completedTasks.Add(1)
f.completedTasks.Inc()
time.Sleep(10 * time.Millisecond) // Simulate task processing time to add some latency.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the sleep be before the task is counted as completed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not necessarilly but I changed that.

@salvacorts salvacorts merged commit 8ebce00 into main Jun 26, 2024
61 checks passed
@salvacorts salvacorts deleted the salvacorts/bloom-refactor/retry-in-builder branch June 26, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants