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

sessionctx: fix a deadlock when set tidb_restricted_read_only = true #55407

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

Defined2014
Copy link
Contributor

@Defined2014 Defined2014 commented Aug 14, 2024

What problem does this PR solve?

Issue Number: close #55373, close #53822,

Problem Summary: follow #40283

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

run shell below, reach more than 10000

count=0
while true; do
mysql -h 127.0.0.1 -P 4000 -u root -e "set global tidb_restricted_read_only = 1;set global tidb_restricted_read_only = 0;";
count=$((count+1))
echo "$count"
done
  • 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 release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 14, 2024
Copy link

tiprow bot commented Aug 14, 2024

Hi @Defined2014. 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-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. and removed do-not-merge/needs-triage-completed labels Aug 14, 2024
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 75.1637%. Comparing base (bab3667) to head (6f1fc8c).
Report is 12 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #55407        +/-   ##
================================================
+ Coverage   74.9822%   75.1637%   +0.1815%     
================================================
  Files          1576       1577         +1     
  Lines        365580     443312     +77732     
================================================
+ Hits         274120     333210     +59090     
- Misses        71731      90020     +18289     
- Partials      19729      20082       +353     
Flag Coverage Δ
integration 49.6104% <40.0000%> (?)
unit 72.2487% <40.0000%> (-1.7342%) ⬇️

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

Components Coverage Δ
dumpling 52.9567% <ø> (-2.2327%) ⬇️
parser ∅ <ø> (∅)
br 52.5729% <ø> (+4.7546%) ⬆️

@Defined2014
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 14, 2024

@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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-sigs/prow repository.

@Defined2014 Defined2014 requested a review from xhebox August 14, 2024 07:59
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 14, 2024
Copy link

ti-chi-bot bot commented Aug 14, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-14 06:54:51.915812813 +0000 UTC m=+337376.619282451: ☑️ agreed by hawkingrei.
  • 2024-08-14 08:23:42.352758852 +0000 UTC m=+342707.056228508: ☑️ agreed by CbcWestwolf.

Copy link

tiprow bot commented Aug 14, 2024

@Defined2014: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 6f1fc8c link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@easonn7
Copy link

easonn7 commented Aug 14, 2024

/approve

Copy link

ti-chi-bot bot commented Aug 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CbcWestwolf, easonn7, hawkingrei

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 Aug 14, 2024
@Defined2014 Defined2014 changed the title sessionctx: fix potential deadlock sessionctx: fix potential deadlock in setGlobalVars Aug 14, 2024
@Defined2014 Defined2014 changed the title sessionctx: fix potential deadlock in setGlobalVars sessionctx: fix a deadlock in setGlobalVars Aug 14, 2024
@Defined2014 Defined2014 changed the title sessionctx: fix a deadlock in setGlobalVars sessionctx: fix a deadlock when set tidb_restricted_read_only Aug 14, 2024
@Defined2014 Defined2014 changed the title sessionctx: fix a deadlock when set tidb_restricted_read_only sessionctx: fix a deadlock when set tidb_restricted_read_only = true Aug 14, 2024
@Defined2014
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 14, 2024

@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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-sigs/prow repository.

@Defined2014
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 14, 2024

@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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-sigs/prow repository.

@Defined2014
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Aug 14, 2024

@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot merged commit 1b172b6 into pingcap:master Aug 14, 2024
22 of 23 checks passed
@Defined2014 Defined2014 deleted the fix-55373 branch August 14, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
4 participants