Commit 04ea6c1
refactor(query): simplify SpillsBufferPool with owned runtime and configurable settings (#19781)
* refactor(query): simplify SpillsBufferPool with owned runtime and configurable settings
- SpillsBufferPool now owns a dedicated Runtime instead of borrowing GlobalIORuntime
- Remove SpillTarget from public buffer pool APIs; callers no longer derive it
- Add spill_buffer_pool_memory and spill_buffer_pool_workers to SpillConfig
- Track buffer pool blocking time via atomic counters for observability
- Simplify BufferWriter by removing SpillTarget and redundant comments
- Clean up tests to use multi_thread tokio flavor
* z
* z
* fix(query): prevent hang in SpillsBufferPool by spawning Fetch and CreateWriter ops
Background workers were directly awaiting Fetch and CreateWriter ops in
their event loop, blocking the worker thread for the duration of the I/O.
With only 2 workers, concurrent Fetch/CreateWriter ops could starve
reader_task_loop tasks (spawned via tokio::spawn onto the same runtime),
causing recv_blocking() in SpillsDataReader::read() to hang indefinitely.
Fix: spawn Fetch and CreateWriter as independent tasks, consistent with
WriterTask and ReaderTask, so workers remain free to dequeue new ops.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* z
* z
* z
* z
* z
* z
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 51f9cd7 commit 04ea6c1
10 files changed
Lines changed: 354 additions & 470 deletions
File tree
- src/query
- config/src
- service
- src
- pipelines/processors/transforms
- aggregator/new_aggregate
- new_hash_join/grace
- spillers
- tests/it/storages/testdata
- storages/parquet/src/parquet_reader
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3481 | 3481 | | |
3482 | 3482 | | |
3483 | 3483 | | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
3484 | 3492 | | |
3485 | 3493 | | |
3486 | 3494 | | |
| |||
3594 | 3602 | | |
3595 | 3603 | | |
3596 | 3604 | | |
| 3605 | + | |
| 3606 | + | |
3597 | 3607 | | |
3598 | 3608 | | |
3599 | 3609 | | |
| |||
3616 | 3626 | | |
3617 | 3627 | | |
3618 | 3628 | | |
| 3629 | + | |
| 3630 | + | |
3619 | 3631 | | |
3620 | 3632 | | |
3621 | 3633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
436 | 442 | | |
437 | 443 | | |
438 | 444 | | |
| |||
503 | 509 | | |
504 | 510 | | |
505 | 511 | | |
| 512 | + | |
| 513 | + | |
506 | 514 | | |
507 | 515 | | |
508 | 516 | | |
| |||
519 | 527 | | |
520 | 528 | | |
521 | 529 | | |
| 530 | + | |
| 531 | + | |
522 | 532 | | |
523 | 533 | | |
524 | 534 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
221 | 223 | | |
222 | 224 | | |
223 | 225 | | |
| |||
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
230 | | - | |
231 | 232 | | |
| 233 | + | |
| 234 | + | |
232 | 235 | | |
233 | 236 | | |
234 | 237 | | |
| |||
384 | 387 | | |
385 | 388 | | |
386 | 389 | | |
387 | | - | |
388 | 390 | | |
| 391 | + | |
| 392 | + | |
389 | 393 | | |
390 | 394 | | |
391 | 395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
| 60 | + | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
| |||
414 | 413 | | |
415 | 414 | | |
416 | 415 | | |
| 416 | + | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
281 | 282 | | |
282 | 283 | | |
283 | | - | |
| 284 | + | |
284 | 285 | | |
285 | 286 | | |
286 | 287 | | |
| |||
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
420 | | - | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
| 503 | + | |
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
| |||
511 | 512 | | |
512 | 513 | | |
513 | 514 | | |
514 | | - | |
| 515 | + | |
515 | 516 | | |
516 | 517 | | |
517 | 518 | | |
| |||
0 commit comments