Skip to content
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

distsql: do not merge unconsumed CopStats if not belong to user sessions #51950

Merged
merged 5 commits into from
Mar 26, 2024

Conversation

jiyfhust
Copy link
Contributor

@jiyfhust jiyfhust commented Mar 20, 2024

What problem does this PR solve?

Issue Number: close #51928 close #51951

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 20, 2024
Copy link

tiprow bot commented Mar 20, 2024

Hi @jiyfhust. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jiyfhust
Copy link
Contributor Author

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Mar 20, 2024
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Merging #51950 (2082420) into master (094f4df) will decrease coverage by 15.9891%.
The diff coverage is 100.0000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #51950         +/-   ##
=================================================
- Coverage   70.6790%   54.6899%   -15.9891%     
=================================================
  Files          1486       1597        +111     
  Lines        439484     609136     +169652     
=================================================
+ Hits         310623     333136      +22513     
- Misses       109348     252785     +143437     
- Partials      19513      23215       +3702     
Flag Coverage Δ
integration 36.6544% <100.0000%> (?)
unit 70.4503% <100.0000%> (-0.0405%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 51.4276% <ø> (+5.6206%) ⬆️

This reverts commit 595b336.
@jiyfhust
Copy link
Contributor Author

/cc @crazycs520

@ti-chi-bot ti-chi-bot bot requested a review from crazycs520 March 20, 2024 09:43
@jiyfhust jiyfhust changed the title distsql: not merge unconsumed CopStats if not user session distsql: do not merge unconsumed CopStats if not belong to user sessions Mar 21, 2024
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 21, 2024
for _, copStats := range unconsumedCopStats {
_ = r.updateCopRuntimeStats(context.Background(), copStats, time.Duration(0))
r.ctx.GetSessionVars().StmtCtx.MergeExecDetails(&copStats.ExecDetails, nil)
if r.ctx != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If r.ctx == nil, L624 also panics.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May there is some relationship between r.stats != nil and r.ctx != nil, because L624 is not new introduced and not sure if it ever paniced before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add judgement r.ctx != nil to check it by 8e0d4cc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, both ctx and stats are not set for check sum requests.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 21, 2024
Copy link

ti-chi-bot bot commented Mar 21, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-21 08:00:17.439766971 +0000 UTC m=+1536444.462013360: ☑️ agreed by crazycs520.
  • 2024-03-21 09:10:38.167980164 +0000 UTC m=+1540665.190226555: ☑️ agreed by you06.

@lcwangchao
Copy link
Collaborator

/check-issue-triage-complete

@jiyfhust
Copy link
Contributor Author

please assign cfzjywxk for approval.

PTAL @cfzjywxk

@jiyfhust
Copy link
Contributor Author

/cc @cfzjywxk

Copy link

ti-chi-bot bot commented Mar 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, crazycs520, you06

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Mar 26, 2024
@ti-chi-bot ti-chi-bot bot merged commit 5d5913d into pingcap:master Mar 26, 2024
23 checks passed
@jiyfhust jiyfhust deleted the fix_runtime_merge_unconsumed branch March 27, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
5 participants