-
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
ddl: fix concurrent access to do.infoHandle
has a data race error
#8287
Conversation
do.infoHandle
has a data race errordo.infoHandle
has a data race error
/run-all-tests |
1 similar comment
/run-all-tests |
domain/domain.go
Outdated
@@ -535,7 +535,8 @@ func NewDomain(store kv.Storage, ddlLease time.Duration, statsLease time.Duratio | |||
|
|||
// ResetHandle resets the domain's infoschema handle. It is used for testing. | |||
func (do *Domain) ResetHandle(store kv.Storage) { |
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.
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.
Call do.Reload still has data race.
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.
This function is used to reset the handle. Reload
can't do it.
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.
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.
It's used for testing. You can see it in "TestHalfwayCancelOperations". @tiancaiamao
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.
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.
@zimulala What do you mean?
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.
@zimulala @tiancaiamao Are we going to continue using s.dom.ResetHandle
?
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.
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.
@zimulala modified test failed to pass.
36ad682
to
35bbf56
Compare
6b02ccf
to
ce4d765
Compare
8bc3405
to
435ebc5
Compare
/run-all-tests |
domain/domain.go
Outdated
// InfoSchema gets information schema from domain. | ||
func (do *Domain) InfoSchema() infoschema.InfoSchema { | ||
return do.infoHandle.Get() |
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.
All the read at do.infoHandle need to be protected.
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.
@winkyao Done.
/run-all-tests |
/run-integration-common-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.
LGTM
/run-common-test tidb-test=pr/649 |
This PR need to be cherry-pick to 2.1 and 2.0 |
a79fad4
to
1cbd0a3
Compare
/run-all-tests |
1 similar comment
/run-all-tests |
efb6c71
to
c46e366
Compare
/run-all-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
/run-common-test tidb-test=pr/668 |
/run-integration-common-test tidb-test=pr/668 |
77e25cc
to
74ccab6
Compare
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
LGTM |
What problem does this PR solve?
What is changed and how it works?
Check List
Tests
This change is