Always notify subscribers on membership change #6283
Merged
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.
Currently there is an issue:
regardless
Because of that we were sometimes missing notifications in history and matching and didn't get any before the next rollout / restart.
What changed?
Subscribers of MultiringResolver were not notified if membership updated during periodic updates
Why?
Subscribers of MultiringResolver expect to be always notified on membership changes, and it doesn't really matter who triggered tag - membership update that we caught or periodic update which we do every 10s.
How did you test it?
This should just work this way, and it is been a mistake to decouple refresh/notify
Verified it on staging environments of Uber where we already see improvements during restart.
Potential risks
If some subscribers rely on event triggered the change, it can be unexpected to see an empty one (but not nil!).
At the same time, we're currently doing the same if Lookup wasn't able to find a host - we were implicitely pushing an empty changedEvent to signal the channel.
Currently existing subscriber does not rely, they simply ignore the event. In fact - it is a mistake to do the opposite: the event just triggered refresh(), but then even the refresh() builds a ring from scratch ignoring the event.
Release notes
Bugfix: Subscribers of MultiringResolver were not notified if membership updated during periodic updates