Commit 51cc661
authored
Remote execution of query plans in queriers (#12302)
#### What this PR does
This PR adds support for remote execution of query plans in queriers.
Query-frontends can now send a Protobuf message (instead of a smuggled
HTTP request) to queriers via query-schedulers, and queriers will
respond with a stream of results. This has been implemented in a way
where we can add other kinds of query requests and responses in the
future, with the goal of eventually moving away from smuggling HTTP
requests in Protobuf messages.
In the case of queries, query-frontends can now send a query plan and
request evaluation of a particular node in the plan, and queriers will
respond with results for that node.
I've also added a HTTP endpoint to queriers for debugging purposes
(`/api/v1/evaluate`), and a CLI tool to exercise this
(`tools/evaluate-query-plan`). I plan to remove this in a subsequent PR,
once I've added the functionality to query-frontends to send these
requests to queriers.
Not included in this PR:
* batching of responses to query-frontends (each series' data is sent as
its own Protobuf message for now)
* actually sending requests from query-frontends
* metrics and tracing for requests to queriers
There are a number of other items I'll handle in follow up PRs (eg.
propagating strong consistency information and dealing with query stats)
- my goal with this PR is to get the general structure in place and
start getting feedback on the approach before I invest too much more
time in this.
I've chosen not to add a changelog entry given this code is not actively
used at present, but open to other opinions on this.
#### Which issue(s) this PR fixes or relates to
(none)
#### Checklist
- [x] Tests updated.
- [n/a] Documentation added.
- [n/a] `CHANGELOG.md` updated - the order of entries should be
`[CHANGE]`, `[FEATURE]`, `[ENHANCEMENT]`, `[BUGFIX]`. If changelog entry
is not needed, please add the `changelog-not-needed` label to the PR.
- [n/a]
[`about-versioning.md`](https://github.com/grafana/mimir/blob/main/docs/sources/mimir/configure/about-versioning.md)
updated with experimental features.1 parent a70b72d commit 51cc661
File tree
30 files changed
+8326
-386
lines changed- pkg
- api
- frontend/v2
- frontendv2pb
- mimir
- querier
- querierpb
- worker
- scheduler
- queue
- schedulerpb
- streamingpromql
- planning
- tools/evaluate-query-plan
30 files changed
+8326
-386
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
479 | 483 | | |
480 | 484 | | |
481 | 485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| |||
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
314 | | - | |
315 | | - | |
316 | | - | |
| 315 | + | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
345 | 349 | | |
346 | 350 | | |
347 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
0 commit comments