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

Shards Series API. #3856

Merged
merged 2 commits into from
Jul 7, 2021
Merged

Shards Series API. #3856

merged 2 commits into from
Jul 7, 2021

Conversation

cyriltovena
Copy link
Contributor

This PR introduces Series Queries Sharding. It does not check the boundaries of ingesters data since I'm assuming
#3852 will be merge first.

Signed-off-by: Cyril Tovena cyril.tovena@gmail.com

This PR introduces Series Queries Sharding. It does not check the boundaries of ingesters data since I'm assuming
grafana#3852 will be merge first.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@cyriltovena cyriltovena requested a review from owen-d July 7, 2021 08:52
Comment on lines +253 to +262
requests := make([]queryrange.Request, 0, conf.RowShards)
for i := 0; i < int(conf.RowShards); i++ {
shardedRequest := *req
shardedRequest.Shards = []string{astmapper.ShardAnnotation{
Shard: i,
Of: int(conf.RowShards),
}.String()}
requests = append(requests, &shardedRequest)
}
requestResponses, err := queryrange.DoRequests(ctx, ss.next, requests, ss.limits)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is where some of the magic happens. Multiple requests are made. Are they going to the same endpoint? How are they load balanced? Also, how is the endpoint defined?

Copy link
Member

@owen-d owen-d Jul 7, 2021

Choose a reason for hiding this comment

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

These are dispatched from the query frontend to queriers according to the sharding factor. The queriers then will request from the store (and ingesters if necessary - determined by the time range of the request since ingesters hold recent data). Both the store and the ingesters now have the ability to discern and filter results down to a specified shard.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. How are the queries routed to the inhesters?

Copy link
Contributor Author

@cyriltovena cyriltovena Jul 8, 2021

Choose a reason for hiding this comment

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

frontend -> queriers -> ingester

Copy link
Contributor

Choose a reason for hiding this comment

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

And if we have multiple queriers? Is the a load balancer?

@owen-d owen-d merged commit bee4567 into grafana:main Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants