-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix(shared-sub): stop monitoring remote subscribers to avoid races [r58] #15884
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
Merged
keynslug
merged 21 commits into
emqx:release-58
from
keynslug:fix/EMQX-14477/r58/nomon-remote-sharedsub
Sep 17, 2025
Merged
fix(shared-sub): stop monitoring remote subscribers to avoid races [r58] #15884
keynslug
merged 21 commits into
emqx:release-58
from
keynslug:fix/EMQX-14477/r58/nomon-remote-sharedsub
Sep 17, 2025
+419
−171
Conversation
This file contains hidden or 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
2f7a050 to
46420f3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-58 #15884 +/- ##
============================================
Coverage 82.29% 82.30%
============================================
Files 1020 1021 +1
Lines 71664 71792 +128
============================================
+ Hits 58978 59086 +108
- Misses 12686 12706 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Server `emqx_shared_sub` manages its own monitors and runs cleanups. Moreover, during high disconnect rate it can be overloaded with DOWN signals, and `unsubscribe/3` call can easily timeout.
<
8000
/div>
_Orphaned_ node here means a node that is marked as "routing node" in the respective table but cluster membership does not know about it.
Which uncovers an oversight in `emqx_router_helper` implementation: it is too eager to purge "leaving" nodes even though by the time it receives respective membership event, a node has essentially just started leaving, but not finished.
And don't react to membership events right away.
Which brings in force-leave announcements to make `emqx_router_helper` react quicker to cluster membership changes.
Prior to this changes, multiple nodes could in general react to shared subscriber going down. If, due to load skew, remote node reacted to this event earlier than local node, leftover state started to accumulate: this would have eventually manifested in global routing table inconsistencies.
This is temporary in a sense, `emqx_router_helper` needs to be refactored into a generic component responsible for cleaning up dead nodes' stuff.
As they are taken care of by `emqx_router_helper` already anyway.
This change: * Helps to avoid full-scans that were happening in `cleanup_down/1`. * Simplifies things.
46420f3 to
00d6219
Compare
savonarola
approved these changes
Sep 17, 2025
zmstone
approved these changes
Sep 17, 2025
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.
Fixes EMQX-14718.
Release version: 5.8.9
Summary
Backports of #14936 + #15396 + #15518.
PR Checklist
changes/ee/(feat|perf|fix|breaking)-<PR-id>.en.mdfiles