Skip to content
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

bug/regression: node ca be started on multiple clusters #2552

Closed
fbarbu15 opened this issue Mar 25, 2024 · 5 comments
Closed

bug/regression: node ca be started on multiple clusters #2552

fbarbu15 opened this issue Mar 25, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@fbarbu15
Copy link
Contributor

A node can be started now with multiple clusters by using ex: --pubsub-topic=/waku/2/rs/2/0 --pubsub-topic=/waku/2/rs/3/0

docker run -i -t -p 10255:10255 -p 10256:10256 -p 10257:10257 -p 10258:10258 -p 10259:10259 harbor.status.im/wakuorg/nwaku:latest --listen-address=0.0.0.0 --rest=true --rest-admin=true --websocket-support=true --log-level=TRACE --rest-relay-cache-capacity=100 --websocket-port=10257 --rest-port=10255 --tcp-port=10256 --discv5-udp-port=10258 --rest-address=0.0.0.0 --nat=extip:172.18.222.250 --peer-exchange=true --discv5-discovery=true --cluster-id=2 --metrics-server=true --metrics-server-address=0.0.0.0 --metrics-server-port=10259 --metrics-logging=true --relay=true --nodekey=30348dd51465150e04a5d9d932c72864c8967f806cce60b5d26afeca1e77eb68 --pubsub-topic=/waku/2/rs/2/0 --pubsub-topic=/waku/2/rs/3/0

And you can relay and receive messages on both clusters

This was not possible on v0.26.0

@fbarbu15 fbarbu15 added the bug Something isn't working label Mar 25, 2024
@gabrielmer gabrielmer self-assigned this May 14, 2024
@gabrielmer
Copy link
Contributor

Seems that this happens because if we don't define a cluster-id, it implies that we use cluster-id=0 and we override its pubsub topics for "/waku/2/default-waku/proto"

nwaku/waku/factory/waku.nim

Lines 109 to 112 in 840e012

# cluster-id=0
of 0:
let clusterZeroConf = ClusterConf.ClusterZeroConf()
confCopy.pubsubTopics = clusterZeroConf.pubsubTopics

If we set a cluster-id in which we don't override the pubsub topics, for example running

./build/wakunode2 --pubsub-topic=/waku/2/rs/2/0 --pubsub-topic=/waku/2/rs/3/0 --cluster-id=2

we do get the error

ERR 2024-05-14 15:35:59.034+02:00 Waku initialization failed                 topics="wakunode main" tid=10401565 file=wakunode2.nim:79 error="Failed setting up node: failed to create record: failed to parse pubsub topic: use shards with the same cluster Id."

@fbarbu15 wdyt?

@fbarbu15
Copy link
Contributor Author

Ok, makes sense. Closing as not a bug then. Thank you

@alrevuelta
Copy link
Contributor

Reopening. Doesn't matter how the node is configured, a node should never be running in multiple clusters. In the case @gabrielmer states its protected, but in the one you showed its not.

@alrevuelta alrevuelta reopened this May 14, 2024
@gabrielmer
Copy link
Contributor

Reopening. Doesn't matter how the node is configured, a node should never be running in multiple clusters. In the case @gabrielmer states its protected, but in the one you showed its not.

Not sure I understand. If we start the node in clusterId 0, the pubsub topics are going to be overriden for the default one and the end result is the node running in clusterId 0 with the default pubsub topic. The protection is still in place, but because the pubsub topics get overriden for a valid one then there's no error.

Should we not override the configurations for clusterId 0?

@alrevuelta
Copy link
Contributor

After discussing with @gabrielmer the behavior is expected. Cluster-id=0 overrides whatever topics are configured. We could warn but that's expected.

We can close since named sharding will be revomed and this won't happen afterward.
#2163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants