Skip to content

Fix origin announcement to use primary connection in cluster#911

Merged
kixelated merged 1 commit intomainfrom
claude/fix-cluster-node-announcement-RH6Sg
Feb 5, 2026
Merged

Fix origin announcement to use primary connection in cluster#911
kixelated merged 1 commit intomainfrom
claude/fix-cluster-node-announcement-RH6Sg

Conversation

@kixelated
Copy link
Collaborator

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

  • Changed origin announcement to use primary connection instead of secondary
  • Added clarifying comments explaining that secondary is for learning from other nodes while primary is for sharing with them
  • Wrapped the primary connection with the configured prefix using with_root() before publishing, consistent with error handling patterns in the codebase

Implementation 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 the secondary connection which is only for receiving announcements from other nodes, not for broadcasting our own announcements.

https://claude.ai/code/session_01LakUrAKWkCz57X2fFjU5C5

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
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Walkthrough

This 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)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: fixing origin announcement to use the primary connection in the cluster relay.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the bug fix, the specific changes made, and the implementation details.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/fix-cluster-node-announcement-RH6Sg

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kixelated kixelated merged commit bdbeb61 into main Feb 5, 2026
1 check passed
@kixelated kixelated deleted the claude/fix-cluster-node-announcement-RH6Sg branch February 5, 2026 17:33
@moq-bot moq-bot bot mentioned this pull request Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants