-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Chore](query) add _query_ctx_map_delay_delete #59262
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
Conversation
|
run buildall |
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
run buildall |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
| if (!handler->empty()) { | ||
| _query_ctx_map_delay_delete.insert(query_id, query_ctx); | ||
| } | ||
| } |
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.
should also deal with the timeout logic if FE not send cancel message to BE. like the code at line 974
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
|
run buildall |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
PR approved by at least one committer and no changes requested. |
mrhhsg
left a comment
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.
lgtm
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.
What problem does this PR solve?
This pull request introduces a delayed deletion mechanism for
QueryContextobjects 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:
_query_ctx_map_delay_deletetoFragmentMgrto keepQueryContextobjects alive for a short period after query EOS, ensuring that the runtime filter coordinator can complete its work.FragmentMgr::remove_query_contextto erase entries from_query_ctx_map_delay_deleteas part of the cleanup process.QueryContextdestructor to callremove_query_contextonly if the fragment manager is available, preventing issues during unit tests.Runtime Filter Merge Coordination:
FragmentMgr::_get_or_create_query_ctx, now inserts theQueryContextinto_query_ctx_map_delay_deleteif the runtime filter merge handler is not empty, ensuring the context is retained for merging.empty()method toRuntimeFilterMergeControllerEntityto check if the filter map is empty, which is used to determine if delayed deletion is needed.Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)