Uh oh!
There was an error while loading. Please reload this page.
[opt](query cancel) cancel query if it has pipeline task leakage - #39223
Conversation
doris-robot
commented
Aug 12, 2024
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
5eb9c7c to
af8853fCompareRoanHeNaN
commented
Aug 12, 2024
run buildall |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| DEFINE_mInt16(topn_agg_limit_multiplier, "2"); | ||
| DEFINE_mInt64(pipeline_task_leakage_detect_period_sec, "60"); |
| for (const auto& query_id : query_ids_and_rpc_succeed.first) { | ||
| LOG_INFO("Running query id: {}", print_id(query_id)); | ||
| result_ref.insert(query_id); |
There was a problem hiding this comment.
可能不能这么写,如果一个fe fetch 失败,我们不能认为这个fe 上运行的query 是空的,此时应该认为都是合理的。
There was a problem hiding this comment.
如果 FE fetch 失败的话,不会到这里,216 行直接返回 false 了。
Uh oh!
There was an error while loading. Please reload this page.
doris-robot
commented
Aug 12, 2024
TPC-H: Total hot run time: 39804 ms |
doris-robot
commented
Aug 12, 2024
TPC-DS: Total hot run time: 202724 ms |
doris-robot
commented
Aug 12, 2024
ClickBench: Total hot run time: 31.33 s |
RoanHeNaN
commented
Aug 13, 2024
run buildall |
Uh oh!
There was an error while loading. Please reload this page.
doris-robot
commented
Aug 13, 2024
TPC-H: Total hot run time: 40396 ms |
doris-robot
commented
Aug 13, 2024
TPC-DS: Total hot run time: 184586 ms |
doris-robot
commented
Aug 13, 2024
ClickBench: Total hot run time: 30.89 s |
RoanHeNaN
commented
Aug 13, 2024
run buildall |
doris-robot
commented
Aug 13, 2024
TPC-H: Total hot run time: 40116 ms |
doris-robot
commented
Aug 13, 2024
TPC-DS: Total hot run time: 185556 ms |
doris-robot
commented
Aug 13, 2024
ClickBench: Total hot run time: 31.25 s |
| const std::map<TNetworkAddress, FrontendInfo>& running_fes = | ||
| ExecEnv::GetInstance()->get_running_frontends(); | ||
| std::vector<TNetworkAddress> qualified_fes; |
There was a problem hiding this comment.
我们的返回值,不应该是一个set
应该是 map<feuid,set>
我们检测的时候,应该检测一个query的fe uid 在这个map里,同时他不在后面这个set里,那么表示这个是不合理的。
There was a problem hiding this comment.
如果一个query的feuid,从这个map 里找不到,那么就不应该处理
| auto future_status = future.wait_for(std::chrono::seconds(3)); | ||
| if (future_status != std::future_status::ready) { | ||
| LOG_WARNING("Fetch running queries from frontend timeout"); | ||
| continue; |
There was a problem hiding this comment.
这里为啥是continue? 而不是报错?return false
| // 2. the fe is starting, hb has not come yet | ||
| // 3. this query does not have coordinator at all (eg. streamload, spark connector) | ||
| if (q_ctx->get_fe_process_uuid() == 0) { | ||
| white_list_queries.insert(q_ctx->query_id()); |
There was a problem hiding this comment.
不用这个, 按道理说,如果get running queries 返回的是map,那么只要这个query的fe uid 不在这个map,那么就应该忽略
| // Typically, this means this query is invalid, eg. we have some bugs in pipeline scheduler which | ||
| // makes the query can not be closed normally. | ||
| // We need to cancel these query to release resources. | ||
| LOG_ERROR( |
Uh oh!
There was an error while loading. Please reload this page.
RoanHeNaN
commented
Aug 14, 2024
run buildall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
RoanHeNaN
commented
Aug 14, 2024
run buildall |
doris-robot
commented
Aug 14, 2024
TPC-H: Total hot run time: 38033 ms |
doris-robot
commented
Aug 14, 2024
TPC-DS: Total hot run time: 184060 ms |
doris-robot
commented
Aug 14, 2024
ClickBench: Total hot run time: 30.94 s |
RoanHeNaN
commented
Aug 15, 2024
run buildall |
doris-robot
commented
Aug 15, 2024
TPC-H: Total hot run time: 37700 ms |
doris-robot
commented
Aug 15, 2024
TPC-DS: Total hot run time: 189947 ms |
doris-robot
commented
Aug 15, 2024
ClickBench: Total hot run time: 30.25 s |
RoanHeNaN
commented
Aug 15, 2024
run buildall |
doris-robot
commented
Aug 15, 2024
TPC-H: Total hot run time: 37966 ms |
doris-robot
commented
Aug 15, 2024
TPC-DS: Total hot run time: 189933 ms |
doris-robot
commented
Aug 15, 2024
ClickBench: Total hot run time: 30.85 s |
) * Problem We are currently facing an issue where pipeline tasks experience leaks in certain situations. The leak in pipeline tasks refers to the scenario where a query has already been completed, but its associated data structures still persist on the backend (BE). This could lead to some memory or computational resources on the BE never being released. * Fix We will periodically reconcile queries with the Frontend (FE) in the cancel work thread. Once we detect that a query has been completed on the FE but still exists on the Backend (BE), we will cancel the query to promptly release the resources. To avoid mistakenly triggering cancellations, we employ a conservative strategy. For instance, we will not proactively cancel queries if we detect any FE is in an abnormal state or if there are network conflicts.
…che#39223) * Problem We are currently facing an issue where pipeline tasks experience leaks in certain situations. The leak in pipeline tasks refers to the scenario where a query has already been completed, but its associated data structures still persist on the backend (BE). This could lead to some memory or computational resources on the BE never being released. * Fix We will periodically reconcile queries with the Frontend (FE) in the cancel work thread. Once we detect that a query has been completed on the FE but still exists on the Backend (BE), we will cancel the query to promptly release the resources. To avoid mistakenly triggering cancellations, we employ a conservative strategy. For instance, we will not proactively cancel queries if we detect any FE is in an abnormal state or if there are network conflicts.
We are currently facing an issue where pipeline tasks experience leaks in certain situations. The leak in pipeline tasks refers to the scenario where a query has already been completed, but its associated data structures still persist on the backend (BE). This could lead to some memory or computational resources on the BE never being released.
We will periodically reconcile queries with the Frontend (FE) in the cancel work thread. Once we detect that a query has been completed on the FE but still exists on the Backend (BE), we will cancel the query to promptly release the resources. To avoid mistakenly triggering cancellations, we employ a conservative strategy. For instance, we will not proactively cancel queries if we detect any FE is in an abnormal state or if there are network conflicts.