-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Enhancement] merge fragment-profile just in time #51001
base: main
Are you sure you want to change the base?
[Enhancement] merge fragment-profile just in time #51001
Conversation
d4789ca
to
443638e
Compare
if (params.isSetProfile() && params.isDone()) { | ||
int fragmentIndex = execState.getFragmentIndex(); | ||
RuntimeProfile fragmentProfile = mergedFragmentProfiles.get(fragmentIndex); | ||
fragmentProfile.merge(params.profile); |
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.
is this thread-safe?
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.
fixed
91583b0
to
5feb28a
Compare
…tion Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
5feb28a
to
6c3d567
Compare
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
} | ||
} | ||
|
||
// Remove counters from this fragment-profile |
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.
so after merge one instance profile into fragment profile, you actually merged counter and remove counters from instance profile, leave others same as before, right?
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.
yes. add a purgeInstanceRunningProfile
to clarify this process
@@ -337,6 +344,15 @@ public void updateProfile(FragmentInstanceExecState execState, TReportExecStatus | |||
saveRunningProfile(profilingPlan, profile); | |||
LOG.debug("update profile, profilingPlan: {}, profile: {}", profilingPlan, profile); | |||
} | |||
|
|||
// Merge it into fragment-profile if this instance already finished | |||
if (params.isSetProfile() && params.isDone()) { |
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.
so without consider runtime profile uploading, before this pr, every fragment instance profile will keep until merged by profile-worker thread. after this pr, fragment instance profile's counters will merged into fragment immediately in here. If some instance profile upload very slow or profile-worker is super busy, then your pr will help to reduce memory?
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.
change the strategy to handle this case: once a fragment-instance finish, purse that profile and merge it into fragment-profile, it can reduce memory
suggest to add a fe config, so if anything goes wong, we can set it as false |
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 219 / 259 (84.56%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Why I'm doing:
Currently the query profile is generated in a hierarchy way:
The tradeoff:
What I'm doing:
Merge the instance-level profile into fragment-level after it finishes:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: