Skip to content

Gateway node selection strategy fix - hash topic identifier instead of full bytes for stable routing#1567

Merged
fbac merged 1 commit intomainfrom
fix/stable-hash-identifier
Feb 2, 2026
Merged

Gateway node selection strategy fix - hash topic identifier instead of full bytes for stable routing#1567
fbac merged 1 commit intomainfrom
fix/stable-hash-identifier

Conversation

@api-Hypernova
Copy link
Copy Markdown
Contributor

The stable hashing algorithm was including the topic's 1-byte kind prefix, causing different message types for the same entity (e.g., key_packages and welcome_messages for the same installation) to route to different nodes.

This fix ensures that only the identifier portion of the topic is hashed, so all message types for the same entity route to the same node.

…uting

The stable hashing algorithm was including the topic's 1-byte kind prefix,
causing different message types for the same entity (e.g., key_packages and
welcome_messages for the same installation) to route to different nodes.

This fix ensures that only the identifier portion of the topic is hashed,
so all message types for the same entity route to the same node.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@api-Hypernova api-Hypernova self-assigned this Jan 23, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Jan 23, 2026

Hash topic identifier in selectors.HashKey to stabilize gateway routing and update tests to use a ±10% tolerance and new node selection order in stable.go and node_selector_test.go

Change selectors.HashKey to hash topic.Identifier() instead of topic.Bytes(), and update tests for distribution tolerance to ±10% and the expected banned-node reselection order.

📍Where to Start

Start with selectors.HashKey in stable.go, then review test updates in node_selector_test.go.


Macroscope summarized d787ad5.

@api-Hypernova api-Hypernova requested a review from fbac January 23, 2026 22:43
@api-Hypernova api-Hypernova changed the title Gateway fix - hash topic identifier instead of full bytes for stable routing Gateway node selection strategy fix - hash topic identifier instead of full bytes for stable routing Jan 23, 2026
@api-Hypernova api-Hypernova marked this pull request as ready for review January 23, 2026 22:50
@api-Hypernova api-Hypernova requested a review from a team as a code owner January 23, 2026 22:50
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Jan 23, 2026

Hash topic identifier in selectors.HashKey to stabilize gateway routing and update tests to use a ±10% tolerance and new node selection order in stable.go and node_selector_test.go

Change selectors.HashKey to hash topic.Identifier() instead of topic.Bytes(), and update tests for distribution tolerance to ±10% and the expected banned-node reselection order.

📍Where to Start

Start with selectors.HashKey in stable.go, then review test updates in node_selector_test.go.


Macroscope summarized d787ad5.

@fbac fbac merged commit ef048fd into main Feb 2, 2026
12 checks passed
@fbac fbac deleted the fix/stable-hash-identifier branch February 2, 2026 17:14
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