-
Notifications
You must be signed in to change notification settings - Fork 225
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
membuffer: fix data race when IsReadOnly
and Set may be concurrently invoked
#1479
base: master
Are you sure you want to change the base?
Conversation
…ntly invoked Signed-off-by: you06 <[email 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.
Is there a test case in tidb to verify the fix?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk 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:
|
I understand it fixes the data race. I'm just wondering whether it means we are using it correctly. What is the expected behavior when I haven't checked the case yet but a first rough thought might be like:
|
There is a test case in the issue. |
For this question, we're just avoiding the race between This is a large topic because TiDB used to pretend it's executor is running in serial mode. So there may be some hidden issues with high possibility. |
ref pingcap/tidb#56178
TiDB concurrently call
IsReadOnly
and some write operations in union statement, so we need to avoid data race by mutex.