Fix origin announcement to use primary connection in cluster#911
Fix origin announcement to use primary connection in cluster#911
Conversation
The node was announcing itself on its local secondary origin, which is meant for tracking broadcasts learned from OTHER nodes. This meant the announcement stayed local and was never shared with other cluster nodes. The fix: - Announce ourselves on PRIMARY (so it gets shared via run_remote_once which publishes primary to remote nodes) - Continue discovering other nodes from SECONDARY (where we receive announcements from other nodes) This ensures that when a leaf node connects to the root, the root and other leaves can discover it and establish connections. https://claude.ai/code/session_01LakUrAKWkCz57X2fFjU5C5
WalkthroughThis change modifies the announcement flow in the cluster module. Origins are now subscribed from the secondary origin with an attribution note. The leaf origin announcement path has been restructured: instead of publishing directly to the existing origins handle, the code now creates a new announce_origin through the primary origin via the with_root method, then publishes through that new path. This introduces an intermediate primary-origin layer for announcements. The net change is 7 lines added and 2 lines removed in the cluster.rs file. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixed a bug where origin announcements were being published to the wrong connection in the cluster relay. Announcements are now correctly sent through the primary connection so they are properly shared with other nodes.
Changes
primaryconnection instead ofsecondarywith_root()before publishing, consistent with error handling patterns in the codebaseImplementation Details
The fix ensures that when a node announces itself as an origin (leaf node), the announcement goes through the primary connection which is synchronized across the cluster via
run_remote_once. Previously, it was incorrectly using thesecondaryconnection which is only for receiving announcements from other nodes, not for broadcasting our own announcements.https://claude.ai/code/session_01LakUrAKWkCz57X2fFjU5C5