Commit d86daef
authored
[Chore](query) add _query_ctx_map_delay_delete (#59262)
This pull request introduces a delayed deletion mechanism for
`QueryContext` objects in the fragment manager to ensure that runtime
filter merging works correctly after a query reaches its end-of-stream
(EOS). The main changes involve adding a new map to retain query
contexts temporarily, modifying the lifecycle management of query
contexts, and introducing utility methods to support this behavior.
**Query Context Lifecycle Management:**
* Added a new member `_query_ctx_map_delay_delete` to `FragmentMgr` to
keep `QueryContext` objects alive for a short period after query EOS,
ensuring that the runtime filter coordinator can complete its work.
* Modified `FragmentMgr::remove_query_context` to erase entries from
`_query_ctx_map_delay_delete` as part of the cleanup process.
* Updated the `QueryContext` destructor to call `remove_query_context`
only if the fragment manager is available, preventing issues during unit
tests.
**Runtime Filter Merge Coordination:**
* In `FragmentMgr::_get_or_create_query_ctx`, now inserts the
`QueryContext` into `_query_ctx_map_delay_delete` if the runtime filter
merge handler is not empty, ensuring the context is retained for
merging.
* Added an `empty()` method to `RuntimeFilterMergeControllerEntity` to
check if the filter map is empty, which is used to determine if delayed
deletion is needed.1 parent 1cbe487 commit d86daef
File tree
5 files changed
+15
-29
lines changed- be/src
- runtime_filter
- runtime
5 files changed
+15
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
| 673 | + | |
673 | 674 | | |
674 | 675 | | |
675 | 676 | | |
| |||
768 | 769 | | |
769 | 770 | | |
770 | 771 | | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
771 | 775 | | |
772 | 776 | | |
773 | 777 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 234 | | |
238 | 235 | | |
239 | 236 | | |
240 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | 436 | | |
461 | 437 | | |
462 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| |||
0 commit comments