-
Notifications
You must be signed in to change notification settings - Fork 6.1k
ddl: avoid sysvar drift in admin check before drop #65972
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
base: master
Are you sure you want to change the base?
Conversation
|
Hi @fzzf678. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions 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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #65972 +/- ##
================================================
+ Coverage 77.8543% 78.8924% +1.0380%
================================================
Files 1961 1954 -7
Lines 539718 554664 +14946
================================================
+ Hits 420194 437588 +17394
+ Misses 117868 115588 -2280
+ Partials 1656 1488 -168
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
05fbc26 to
0bba5cd
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@fzzf678: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
What problem does this PR solve?
Issue Number: close #65969
Problem Summary:
adminCheckTableBeforeDropmay callExecRestrictedSQLmultiple times. Each call can fetch a different internal session from the system session pool, so the sequenceSET tidb_enable_fast_table_check=ON/ADMIN CHECK TABLE/ restore may land on different sessions. This can breakADMIN CHECK TABLEon features that require fast check (e.g. partial indexes) and may leave the session pool in a polluted state.The previous code also restored
tidb_enable_fast_table_checkusing the user session's value, which can unintentionally propagate a user setting into the internal session pool.What changed and how does it work?
SET ON -> ADMIN CHECK TABLE -> restoresequence on a single internal session acquired once from DDL's session pool.tidb_enable_fast_table_checkto the original value from the same internal session (instead of reading it from the user session).(*session.Pool).Destroy()to discard internal sessions that should not be reused (e.g. sysvar change fails), while keeping the pool slot consistent for bothDestroyableSessionPooland*pools.ResourcePool.tidb_enable_fast_table_checkvalues in the sys session pool and verifiesDROP TABLEsucceeds with partial indexes whencheck-table-before-dropis enabled.Destroy()semantics for both pool types.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.