-
Notifications
You must be signed in to change notification settings - Fork 83
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
Avoid kvset/kvget race on subscriptions update #348
Conversation
When adding or deleting a subscription, we save the subscriptions via `KVSet`, and previously turned around to fetch those with `KVGet` before broadcasting to the client. On installations with a database replica, the second request might not hit the `master` database, and the update just effected might not be "seen". Skip the `KVGet` and instead just use the information about the updated susbcriptions that we already have in hand when updating the client. Fixes: #342
Codecov ReportBase: 32.00% // Head: 32.45% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #348 +/- ##
==========================================
+ Coverage 32.00% 32.45% +0.45%
==========================================
Files 21 21
Lines 3390 3389 -1
==========================================
+ Hits 1085 1100 +15
+ Misses 2196 2182 -14
+ Partials 109 107 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@DHaussermann The PR is ready for your review |
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.
Tested and passed
- Found an affected server and upgraded to ensure the issue is resolved
- Delete command is always reflected in the RHS in real-time
- Tested on in HA as well
No issues found
LGTM!
Summary
When adding or deleting a subscription, we save the subscriptions via
KVSet
, and previously turned around to fetch those withKVGet
before broadcasting to the client. On installations with a database replica, the second request might not hit themaster
database, and the update just effected might not be "seen".Skip the
KVGet
and instead just use the information about the updated susbcriptions that we already have in hand when updating the client.Ticket Link
Fixes: #342