-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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): Delete outdated metas #13153
refactor(blooms): Delete outdated metas #13153
Conversation
4b73f9a
to
fc4f463
Compare
var wg sync.WaitGroup | ||
for tt, results := range tasksResultForTableTenant { | ||
wg.Add(1) | ||
go func(table config.DayTable, tenant string, results tenantTableTaskResults) { |
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 may spawn quite a lot of goroutines.
Idea: Could we use a single results channel? I guess then the problem would be to know when a tenantTable is done, right?
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.
I guess then the problem would be to know when a tenantTable is done, right?
Correct.
This may spawn quite a lot of goroutines.
Indeed. On the other hand, I have this issue open for adding parallel workers to the planner. We can parallelize tenant-tables tuples across those workers and therefore limit the number of goroutines that would be spawned to wait for responses to the number of workers.
This would be similar to how the bloom-compactor currently handles parallelism:
loki/pkg/bloomcompactor/bloomcompactor.go
Line 410 in a9345d0
err := concurrency.ForEachJob(ctx, c.cfg.WorkerParallelism, c.cfg.WorkerParallelism, func(ctx context.Context, idx int) error { |
So I'd address this there. I'll add a TODO.
This reverts commit 9c96d26.
What this PR does / why we need it:
In This PR we implement deletes of outdated metas and blocks. Here's how it work:
Special notes for your reviewer:
planner.loadWork
intoplanner.loadTenantWork
which now returns a map oftable->tenant->[]ownsershipBounds
planner.RunOne
to:planner.loadTenantWork
planner.processTenantTaskResults
which will wait for all tenants to complete and handle deletion.Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PRdeprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR