-
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
feat: Extract task computing into a strategy interface #13690
Conversation
9613863
to
46e36ca
Compare
82bda3c
to
55c25a4
Compare
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.
Docs LGTM
# Conflicts: # pkg/bloombuild/planner/planner_test.go # pkg/validation/limits.go
55c25a4
to
4c7218b
Compare
docs/sources/shared/configuration.md
Outdated
# Experimental. Bloom planning strategy to use in bloom creation. Can be one of: | ||
# 'split' | ||
# CLI flag: -bloom-build.planning-strategy | ||
[bloom_planning_strategy: <string> | default = "split"] |
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.
nit, but IMO "split" is too generic for a planning strategy.
I'd rather call it "split_by_series_count", "split_by_series_keyspace", "split_by_series_volume", etc, or short without the "split_by_" prefix.
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.
Renamed to split_keyspace_by_factor
@@ -0,0 +1,245 @@ | |||
package splitkeyspace |
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.
nit: Is is really necessary to make a separate package for each individual strategy?
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.
Not much to add, but +1 to everything @chaudum mentioned
ctx context.Context, | ||
table config.DayTable, | ||
tenant string, | ||
tsdbs map[tsdb.SingleTenantTSDBIdentifier]common.ClosableForSeries, |
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.
nit: If we create a type alias we could avoid putting each parameter on its own line:
type TSDBSet = map[tsdb.SingleTenantTSDBIdentifier]common.ClosableForSeries
Use require.ElementsMatch in tests to permit plans having a different order; this is what the tests did prior to refactoring in grafana#13690.
What this PR does / why we need it:
We currently plan tasks by dividing the FP keyspace into a configurable number of equally-sized splits (bloom_split_series_keyspace_by per-tenant config).
We want to be able to implement new strategies and make them configurable. In this PR we extract the current planning to a new strategy pkg and create a factory to make the strategy configurable.
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