-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[refactor](Coordinator) refactor coordinator #41730
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
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
clang-tidy review says "All clean, LGTM! 👍" |
2 similar comments
|
clang-tidy review says "All clean, LGTM! 👍" |
|
clang-tidy review says "All clean, LGTM! 👍" |
4314d53 to
66c693a
Compare
|
run buildall |
8 similar comments
|
run buildall |
|
run buildall |
|
run buildall |
|
run buildall |
|
run buildall |
|
run buildall |
|
run buildall |
|
run buildall |
0ec601b to
039b5e1
Compare
|
run buildall |
2 similar comments
|
run buildall |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
|
run buildall |
1 similar comment
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
1 similar comment
|
run buildall |
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
…or (#43763) fix QueryProcessor cannot be cast to class LoadProcessor, introduced by #41730 Problem Summary: sql: any select statement it only meet when open debug log, so I can not write a test ``` 2024-11-12 08:15:52,266 WARN (mysql-nio-pool-0|206) [ConnectProcessor.handleQueryException():480] Process one query failed because unknown reason: java.lang.ClassCastException: class org.apache.doris.qe.runtime.QueryProcessor cannot be cast to class org.apache.doris.qe.runtime.LoadProcessor (org.apache.doris.qe.runtime.QueryProcessor and org.apache.doris.qe.runtime.LoadProcessor are in unnamed module of loader 'app') at org.apache.doris.qe.CoordinatorContext.asLoadProcessor(CoordinatorContext.java:262) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.NereidsCoordinator.getJobId(NereidsCoordinator.java:202) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.QeProcessorImpl.registerQuery(QeProcessorImpl.java:116) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.executeAndSendResult(StmtExecutor.java:1925) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.handleQueryStmt(StmtExecutor.java:1897) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.handleQueryWithRetry(StmtExecutor.java:901) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:833) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:605) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.queryRetry(StmtExecutor.java:568) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:558) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.ConnectProcessor.executeQuery(ConnectProcessor.java:340) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:243) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:209) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:237) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:414) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:840) ~[?:?] ```
…or (apache#43763) fix QueryProcessor cannot be cast to class LoadProcessor, introduced by apache#41730 Problem Summary: sql: any select statement it only meet when open debug log, so I can not write a test ``` 2024-11-12 08:15:52,266 WARN (mysql-nio-pool-0|206) [ConnectProcessor.handleQueryException():480] Process one query failed because unknown reason: java.lang.ClassCastException: class org.apache.doris.qe.runtime.QueryProcessor cannot be cast to class org.apache.doris.qe.runtime.LoadProcessor (org.apache.doris.qe.runtime.QueryProcessor and org.apache.doris.qe.runtime.LoadProcessor are in unnamed module of loader 'app') at org.apache.doris.qe.CoordinatorContext.asLoadProcessor(CoordinatorContext.java:262) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.NereidsCoordinator.getJobId(NereidsCoordinator.java:202) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.QeProcessorImpl.registerQuery(QeProcessorImpl.java:116) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.executeAndSendResult(StmtExecutor.java:1925) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.handleQueryStmt(StmtExecutor.java:1897) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.handleQueryWithRetry(StmtExecutor.java:901) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:833) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:605) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.queryRetry(StmtExecutor.java:568) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:558) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.ConnectProcessor.executeQuery(ConnectProcessor.java:340) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:243) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:209) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:237) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:414) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:840) ~[?:?] ```
fix new coordinator compute a wrong scanRangeNum, introduced by #41730 This bug will show a wrong progress in s3 load: ``` Progress: 0.00%(73/2147483647) ```
optimize new distribute planner performance in tpc-h, because #41730 made some performance rollback has occurred 1. fix the wrong runtime filter thrift parameters 2. not default to print distribute plan in profile, you should config `set profile_level=3` to see it 3. for shuffle join which two sides distribution of natural + execution_bucketed, support compare cost between plans of shuffle to left/right
…property (apache#47888) fix Illegal bucket shuffle join or colocate join in fragment because compute wrong join output property, introduced by apache#41730 the exception: ``` errCode = 2, detailMessage = Illegal bucket shuffle join or colocate join in fragment ```
fix colocate agg + join compute wrong result, introduced by #41730
fix colocate agg + join compute wrong result, introduced by #41730
fix colocate agg + join compute wrong result, introduced by #41730
…8934) fix colocate agg + join compute wrong result, introduced by apache#41730 (cherry picked from commit 0e5abe8)
…property (apache#47888) fix Illegal bucket shuffle join or colocate join in fragment because compute wrong join output property, introduced by apache#41730 the exception: ``` errCode = 2, detailMessage = Illegal bucket shuffle join or colocate join in fragment ```
…8934) fix colocate agg + join compute wrong result, introduced by apache#41730
### What problem does this PR solve? Followup #50791 Add a new FE HTTP API: `/rest/v2/manager/query/statistics/trace_id`. This API will return the query runtime statistic corresponding to a given trace id. The query statistics includes info such as real-time scan rows/bytes. Internally, Doris will get query id by trace id from all Frontends, and then fetch query statistics from BE. Use pattern: 1. User set custom trace id by: `set session_context="trace_id:my_trace_id"` 2. User executes a query in same session 3. Start a http client to get query statistics in real-time during the query process.  Also fix a bug in `CoordinatorContext.java`, to get real host. introduced from #41730 This PR also change the column name of `information_schema.processlist` table, to be same as column name in `show processlist`.
Proposed changes
Use NereidsSqlCoordinator instead of Coordinator because the code of Coordinator is too hard to maintaining
The main design approach is as follows:
DistributePlanner: The logic for calculating parallelism has been extracted in [refactor](nereids) New distribute planner #36531, and in the future, we will dynamically calculate parallelism based on cost.CoordinatorContext: Some global parameters and states related to the Coordinator are encapsulated within CoordinatorContext.PipelineExecutionTask: The entire scheduling task is encapsulated by PipelineExecutionTask, which includes the mapping relationship between each Backend and Pipeline task. PipelineExecutionTask contains two layers of tasks, each responsible for specific duties, with state maintenance handled internally rather than being centralized in the Coordinator.MultiFragmentsPipelineTask: A Backend will generate multiple fragment tasks, which are bundled together and sent concurrently to the corresponding Backend.SingleFragmentPipelineTask: A single fragment task for a Backend.JobProcessor: Describes two types of tasks: SQL tasks and Load tasks.QueryProcessor: Represents query tasks and provides a ResultReceiver to obtain query results.LoadProcessor: Represents Insert into and Broker load tasks, providing a blocking function to wait for load completion.ThriftPlansBuilder: Uses the DistributedPlan structure to build thrift parameters and encapsulates some intermediate temporary variables within functions, rather than placing them in the Coordinator.QeProcessorImplfor cancellation and progress tracking.TODO:
Coordinator