[Refactor](StmtExecutor)(step-1) Extract profile logic from StmtExecutor and Coordinator#19219
Merged
yiguolei merged 2 commits intoapache:masterfrom May 6, 2023
Merged
Conversation
7 tasks
Contributor
Author
|
run buildall |
Contributor
|
TeamCity pipeline, clickbench performance test result: |
b38faa6 to
f08a5fc
Compare
f08a5fc to
4f254b8
Compare
Contributor
Author
|
run buildall |
Reminiscent
pushed a commit
to Reminiscent/doris
that referenced
this pull request
May 15, 2023
…tor and Coordinator (apache#19219) Previously, we use RuntimeProfile class directly, and because there are multiple level in profile, so you can see there may be several RuntimeProfile instances be to maintain. I created several new classes for profile: class Profile: The root profile of a execution task(query or load) class SummaryProfile: The profile that contains summary info of a execution task, such as start time, end time, query id. etc. class ExecutionProfile: The profile for a single Coordinator. Each Coordinator will have a ExecutionProfile. The profile structure is as following: Profile: SummaryProfile: ExecutionProfile 1: Fragment 0: Instance 0: Instance 1: ... Fragment 1: ... ExecutionProfile 2: ... You can see, each Profile has a SummaryProfile and one or more ExecutionProfile. For most kinds of job, such as query/insert, there is only one ExecutionProfile. But for broker load job, will may be more than one ExecutionProfile, corresponding to each sub task of the load job. How to use For query/insert, etc: Each StmtExcutor will have a Profile instance. Each Coordinator will have a ExecutionProfile instance. StmtExcutor is responsible for the SummaryProfile, it will update the SummaryProfile during the execution. Coordinator is responsible for the ExecutionProfile, it will first add ExecutionProfile to the child of Profile, and update the ExecutionProfile periodically during the execution. For Load/Export, etc: Each job will hava a Profile instance. For each Coordinator of this job, add its ExecutionProfile to the children of job's Profile. Behavior Change The columns of show load profile/show query profile and QueryProfile Web UI has changed to: | Profile ID | Task Type | Start Time | End Time | Total | Task State | User | Default Db| Sql Statement | Is Cached | Total Instances Num | Instances Num Per BE | Parallel Fragment Exec Instance Num | Trace ID | The Query Id and Job Id is removed and using Profile ID instead. For load job, the profile id is job id, for query/insert, is query id.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Subtask of #19195
Problem summary
This PR mainly changes:
Add new classes for Profile
Previously, we use
RuntimeProfileclass directly, and because there are multiple level in profile, so you can see there may be severalRuntimeProfileinstances be to maintain.I created several new classes for profile:
The profile structure is as following:
You can see, each
Profilehas aSummaryProfileand one or moreExecutionProfile.For most kinds of job, such as query/insert, there is only one
ExecutionProfile. But for broker load job, will may be more than oneExecutionProfile, corresponding to each sub task of the load job.How to use
For query/insert, etc:
StmtExcutorwill have aProfileinstance.Coordinatorwill have aExecutionProfileinstance.StmtExcutoris responsible for theSummaryProfile, it will update theSummaryProfileduring the execution.Coordinatoris responsible for theExecutionProfile, it will first addExecutionProfileto the child ofProfile, and update theExecutionProfileperiodically during the execution.For Load/Export, etc:
Profileinstance.Coordinatorof this job, add itsExecutionProfileto the children of job'sProfile.Behavior Change
The columns of
show load profile/show query profileandQueryProfileWeb UI has changed to:The
Query IdandJob Idis removed and usingProfile IDinstead.For load job, the profile id is job id, for query/insert, is query id.
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...