-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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(blooms): bloom integration in query planning #12208
Merged
Merged
Changes from 4 commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
b831d07
streaming GetShards on idx-gw + some refactoring
owen-d 91ee79e
moves FingerprintBounds to logproto pkg to avoid circular imports
owen-d 2db2852
proto alignment, wiring `GetShards()` through storage
owen-d 6801fbb
tsdb index `ForSeries()` can signal a stop to iteration
owen-d c2200a0
ForSeries in tsdb.Index ifc
owen-d db1c830
pr feedback
owen-d 693c48b
removes pointers in protos
owen-d 808d88b
gateway `GetShards` impl
owen-d 391093f
[wip] integrating bound ranges into `GetShards()`
owen-d 42dccdd
generic result accumulator
owen-d cc105e0
indexclient getshards impl
owen-d b355b9f
comment
owen-d 14e4815
thread plan+predicate
owen-d c42344e
[wip] HasForSeries wiring
owen-d 3052e2f
finish HasForSeries impl, move ifc to index pkg
owen-d 548fe30
moves HasForSeries to StatsReader
owen-d 272e06f
new sharding pkg
owen-d cfb38a5
removes bounds from shardsrequest
owen-d 8988232
HasForSeries accepts timerange + composite store impl
owen-d 300d710
resultAccumulator doesnt run merge for single list
owen-d 1ea82b1
sorts MultiIndex.GetChunkRefs during merge
owen-d 6bad531
naive implementation of bloom-accelerated sharding calculation in gat…
owen-d 09f1618
extracts & tests accumulating chunks to shards
owen-d 6b8feac
moves common sharding logic to shared pkg, lets idx-gw fallback to St…
owen-d 3629b7b
GatewayClient.poolDoWithStrategy to avoid cascading requests during r…
owen-d a6e0506
shardsrequest compat.go
owen-d 1961eb8
shardsresonse extensions.go
owen-d 27599b7
removes plan from ShardsRequest in favor of a query string which can …
owen-d fdbe1fa
queryrange+codec shardrequesting support + some cleanup to use query …
owen-d 42fe9cf
ShardResolver.GetShardingRanges support
owen-d 3704abc
querier, http wiring for shards request
owen-d 8854fb4
json tags for shard protos
owen-d 32d400d
[unrelated] fixes double-stats-requesting on quantiles
owen-d f8ff1fb
multiple logql shard reprs
owen-d 8118844
logql sharding strategy
owen-d 21a2edd
test alignment
owen-d b9f6121
shard parsing returns verison
owen-d 29cb72a
integrating new shards into label injection
owen-d 7bb381f
aligns inclusivity expectations between sharding impls for Fingerprin…
owen-d b5f2501
integrates shard-bounds into ingesters
owen-d e54db18
tsdb sharding strategy
owen-d 48258a0
ingester fixes
owen-d e7b4930
fix test + docs
owen-d f476128
Merge remote-tracking branch 'upstream/main' into blooms/query-planni…
owen-d f4b4e86
fix ifc alignment
owen-d 189b4e3
gen files
owen-d 91277c8
linting, circular imports, default impls for mocks
owen-d 3f14f1a
preserve old indexreaderwriter behavior
owen-d eda6ef8
goimports -s
owen-d 1f22cee
legacy index reader getshards
owen-d f24c768
adds pre+postfilter chunkref histograms to idx-gws bloom-accelerated …
owen-d 9049d97
corrects shard routing in middleware
owen-d 5d0d1a0
proto response wrapping for new shards types
owen-d 66e5998
promauto for indexgateway metrics
owen-d 5300648
proto roundtripping + lint
owen-d 5f82560
s/table-compaction-period/table-offset/g
owen-d 60b305b
Merge remote-tracking branch 'upstream/main' into blooms/query-planni…
owen-d 37edc8b
Merge remote-tracking branch 'upstream/main' into blooms/query-planni…
owen-d b0350ae
index statistics
owen-d 5b70e96
Merge remote-tracking branch 'upstream/main' into blooms/query-planni…
owen-d db506cb
stats cleanup and proper propagation
owen-d 5ca8d2f
routing stats through store
owen-d d43b3f7
gatewayclient propagates stats
owen-d 52df554
logging fixes
owen-d ce33787
Merge remote-tracking branch 'upstream/main' into blooms/query-planni…
owen-d 3e96e75
Merge remote-tracking branch 'upstream/main' into blooms/query-planni…
owen-d 1e77cee
skip (unhealthy?) bloom-gws with no token range
owen-d fed5262
correctly merges stats in collector middleware for bloom data, some a…
owen-d 2805339
v1 metrics wired up through read path
owen-d 11d8b42
optional pool support for bloom pages
owen-d ade14a9
Merge remote-tracking branch 'upstream/main' into blooms/query-planni…
owen-d 463dafd
test signature
owen-d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,6 +206,41 @@ func (c CompositeStore) Volume(ctx context.Context, userID string, from, through | |
return res, err | ||
} | ||
|
||
func (c CompositeStore) GetShards( | ||
ctx context.Context, | ||
userID string, | ||
from, through model.Time, | ||
targetBytesPerShard uint64, | ||
matchers ...*labels.Matcher, | ||
) ([]*logproto.Shard, error) { | ||
// TODO(owen-d): improve. Since shards aren't easily merge-able, | ||
// we choose the store which returned the highest shard count | ||
var groups [][]*logproto.Shard | ||
err := c.forStores(ctx, from, through, func(innerCtx context.Context, from, through model.Time, store Store) error { | ||
shards, err := store.GetShards(innerCtx, userID, from, through, targetBytesPerShard, matchers...) | ||
if err != nil { | ||
return err | ||
} | ||
groups = append(groups, shards) | ||
return nil | ||
}) | ||
|
||
switch { | ||
case err != nil: | ||
return nil, err | ||
case len(groups) == 1: | ||
return groups[0], nil | ||
case len(groups) == 0: | ||
return nil, nil | ||
default: | ||
sort.Slice(groups, func(i, j int) bool { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since you are looking for the biggest group, you don't need to sort this slice. Instead, you can use slices.MinFunc O(n). |
||
return len(groups[i]) > len(groups[j]) | ||
}) | ||
return groups[0], nil | ||
} | ||
|
||
} | ||
|
||
func (c CompositeStore) GetChunkFetcher(tm model.Time) *fetcher.Fetcher { | ||
// find the schema with the lowest start _after_ tm | ||
j := sort.Search(len(c.stores), func(j int) bool { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 would move the error handling into a regular
if err != nil
statement