-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
infoschema: avoid panic when updating infoschema v2 btree conflicts #58815
Conversation
Hi @tiancaiamao. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with 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. |
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.
rest lgtm
t2.ReplaceOrInsert(item) | ||
succ = ptr.CompareAndSwap(t, t2) | ||
if !succ { | ||
logutil.BgLogger().Info("infoschema v2 btree concurrently multiple writes detected, this should be rare") |
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 it frequent, maybe use SampleLogger, see SampleLoggerFactory
below too
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.
From @lilinghai 's report, the is rare.
And the gcOldVersion() check interval is 1min, and the check not always trigger a real gcOldVersion(), and even it is triggered, it may not always trigger the concurrent write.
@D3Hunter
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #58815 +/- ##
================================================
+ Coverage 73.4645% 75.1210% +1.6564%
================================================
Files 1676 1722 +46
Lines 464424 475176 +10752
================================================
+ Hits 341187 356957 +15770
+ Misses 102397 96030 -6367
- Partials 20840 22189 +1349
Flags with carried forward coverage won't be shown. Click here to find out more.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, wjhuang2016 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 |
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #58712
Problem Summary:
What changed and how does it work?
I check the code again.
If Reload() is thread-safe, the possible write conflict should come from
GCOldVersion()
In this commit, I avoid the panic and add more logs for it.
Check List
Tests
This kind of case is really difficult to test, this is a guess at the best of my effort.
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.