-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix RegisterNotifier to use a copy of the tables to prevent data races #14716
Merged
GuptaManan100
merged 2 commits into
vitessio:main
from
planetscale:engine-register-notifier-fix
Dec 7, 2023
Merged
Fix RegisterNotifier to use a copy of the tables to prevent data races #14716
GuptaManan100
merged 2 commits into
vitessio:main
from
planetscale:engine-register-notifier-fix
Dec 7, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Manan Gupta <[email protected]>
GuptaManan100
requested review from
harshit-gangal,
systay,
shlomi-noach and
rohit-nayak-ps
as code owners
December 7, 2023 10:18
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
vitess-bot
bot
added
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsIssue
A linked issue is missing for this Pull Request
NeedsWebsiteDocsUpdate
What it says
labels
Dec 7, 2023
harshit-gangal
approved these changes
Dec 7, 2023
systay
reviewed
Dec 7, 2023
systay
approved these changes
Dec 7, 2023
systay
removed
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsWebsiteDocsUpdate
What it says
NeedsIssue
A linked issue is missing for this Pull Request
labels
Dec 7, 2023
Signed-off-by: Manan Gupta <[email protected]>
ajm188
approved these changes
Dec 7, 2023
ejortegau
pushed a commit
to slackhq/vitess
that referenced
this pull request
Dec 13, 2023
vitessio#14716) Signed-off-by: Manan Gupta <[email protected]>
@GuptaManan100 Can this be backported into v18? We just encountered this crash on v17 and looking into the code for v18 it looks like it's vulnerable to the same race condition. |
GuptaManan100
added a commit
to planetscale/vitess
that referenced
this pull request
Jul 29, 2024
vitessio#14716) Signed-off-by: Manan Gupta <[email protected]>
@arthurschreiber Here is the PR - #16490 |
GuptaManan100
added a commit
that referenced
this pull request
Jul 29, 2024
…event data races (#14716) (#16490) Signed-off-by: Manan Gupta <[email protected]>
andyedison
pushed a commit
to github/vitess-gh
that referenced
this pull request
Jul 29, 2024
…rNotifier to use a copy of the tables to prevent data races (vitessio#3900) * backport of 3891 * feat: fix build issues Signed-off-by: Manan Gupta <[email protected]> --------- Signed-off-by: Manan Gupta <[email protected]> Co-authored-by: Manan Gupta <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the bug reported in #14715
It was noticed that in
RegisterNotifier
we don't make a copy of thetables
map before sending it to the notifier function.This can cause a data race since the same table is copied over into the queryEngine which tries to read it, while the next reload of schema in the schema engine would try to overwrite it.
The fix is straightforward. We already make a copy of the map in
broadcast
. We should do the same inRegisterNotifier
.A test to make sure that altering the
table
in schema.Engine doesn't impact the notifiers has also been added.Related Issue(s)
Checklist
Deployment Notes