Skip to content

Fix multi node clusters#919

Closed
jhiatt-verkada wants to merge 3 commits intomoq-dev:mainfrom
jhiatt-verkada:fix-multi-node-clusters
Closed

Fix multi node clusters#919
jhiatt-verkada wants to merge 3 commits intomoq-dev:mainfrom
jhiatt-verkada:fix-multi-node-clusters

Conversation

@jhiatt-verkada
Copy link
Contributor

@jhiatt-verkada jhiatt-verkada commented Feb 6, 2026

This is not intended to be mergeable but serves as a proof-of-concept where all cluster node announcements are published on the root node. The cluster leaves specify a query parameter indicating what hostname to publish.

jhiatt-verkada and others added 3 commits February 5, 2026 16:24
- A root node listening on port 4443.
- A leaf node listening on port 4444.
- A leaf node listening on port 4445.

The two leaf nodes will connect to the root node using the `dev/root.jwt` token.

/// The expiration time of the token as a unix timestamp.
#[serde(rename = "exp")]
#[serde(rename = "exp", skip_serializing_if = "Option::is_none")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if anything changed but the token validation code was choking on tokens with "exp": null.

let url = match token.is_empty() {
true => Url::parse(&format!("https://{node}/"))?,
false => Url::parse(&format!("https://{node}/?jwt={token}"))?,
false => Url::parse(&format!("https://{node}/?jwt={token}&node={cluster_node}"))?,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be properly escaped

// Announce ourselves as an origin to the root node.
// This goes into primary so it gets shared with other nodes via run_remote_once.
if let Some(myself) = self.config.node.as_ref() {
if false && let Some(myself) = self.config.node.as_ref() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hack to disable existing publish (should just be deleted)

.accept()
.await?;

let _node_announce = if let Some(cluster_node) = cluster_node
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gets dropped when session ends -> node is unpublished

@kixelated
Copy link
Collaborator

#923 is my version of this, untested

@kixelated
Copy link
Collaborator

replaced by #923

@kixelated kixelated closed this Feb 6, 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.

3 participants