-
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
store: add lock for runtime stats to fix panic caused by concurrent execution (#18983) #18991
store: add lock for runtime stats to fix panic caused by concurrent execution (#18983) #18991
Conversation
Signed-off-by: ti-srebot <[email protected]>
/run-all-tests |
/run-unit-tests |
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.
LGTM
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.
LGTM
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.
LGTM
/merge |
/run-all-tests |
/merge |
@@ -54,6 +54,15 @@ func (s *testSuiteJoin1) TestJoinPanic(c *C) { | |||
tk.MustQuery("SELECT * FROM events e JOIN (SELECT MAX(clock) AS clock FROM events e2 GROUP BY e2.source) e3 ON e3.clock=e.clock") | |||
err := tk.ExecToErr("SELECT * FROM events e JOIN (SELECT clock FROM events e2 GROUP BY e2.source) e3 ON e3.clock=e.clock") | |||
c.Check(err, NotNil) | |||
|
|||
// Test for PR 18983, use to detect race. | |||
tk.MustExec("use test") |
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.
I have tried running this on different TiDB versions, and it is consistently green after and before the fix. I understand that this is a race condition bug and it only happens occasionally, but I doubt that the test that only fails once in a lifetime is really that useful.
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.
Sorry for that, this test is really hard to reproduce, I haven't found a stable reproduction method yet...
cherry-pick #18983 to release-4.0
Signed-off-by: crazycs520 [email protected]
What problem does this PR solve?
fix #18985
What is changed and how it works?
Related changes
Check List
Tests
Side effects
Release note