-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Refactor](StmtExecutor)(step-1) Extract profile logic from StmtExecutor and Coordinator #19219
Conversation
run buildall |
TeamCity pipeline, clickbench performance test result: |
b38faa6
to
f08a5fc
Compare
f08a5fc
to
4f254b8
Compare
run buildall |
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
…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.
Proposed changes
Subtask of #19195
Problem summary
This PR mainly changes:
Add new classes for Profile
Previously, we use
RuntimeProfile
class directly, and because there are multiple level in profile, so you can see there may be severalRuntimeProfile
instances be to maintain.I created several new classes for profile:
The profile structure is as following:
You can see, each
Profile
has aSummaryProfile
and 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:
StmtExcutor
will have aProfile
instance.Coordinator
will have aExecutionProfile
instance.StmtExcutor
is responsible for theSummaryProfile
, it will update theSummaryProfile
during the execution.Coordinator
is responsible for theExecutionProfile
, it will first addExecutionProfile
to the child ofProfile
, and update theExecutionProfile
periodically during the execution.For Load/Export, etc:
Profile
instance.Coordinator
of this job, add itsExecutionProfile
to the children of job'sProfile
.Behavior Change
The columns of
show load profile
/show query profile
andQueryProfile
Web UI has changed to:The
Query Id
andJob Id
is removed and usingProfile ID
instead.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...