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

[Question] Clarification about starting a single-node cluster with raft-non-voter=true #1182

Closed
wellescastro opened this issue Mar 21, 2023 · 9 comments · Fixed by #1186
Closed

Comments

@wellescastro
Copy link

wellescastro commented Mar 21, 2023

Hi! I noticed that if I start a single-node cluster with raft-non-voter=true, the cluster starts appropriately electing the very same node, while I expect it not to work since I'm telling that the node is not a voter. Do you know if this is expected? Is it the 'raft-non-voter' argument being ignored since it would mean an invalid scenario?

This is what I executed in my machine:
.\rqlited.exe -node-id "testDatabase1" -http-addr "127.0.0.1:9501" -raft-addr "127.0.0.1:9502" -raft-non-voter=true testDatabase1

@otoolep
Copy link
Member

otoolep commented Mar 21, 2023

That's interesting, I would need to check. I don't think I've ever tested that scenario (since it shouldn't really be sensible). I can check in a few days, as I'm traveling at the moment.

@otoolep
Copy link
Member

otoolep commented Mar 27, 2023

I looked at the code to refresh my memory.

Operating as a "read-only node" (non-voting) is a cluster-joining -time thing. If you're not joining a cluster, and have no pre-existing state, the raft-non-voter is ignored and the node comes up as a single-node system. You weren't far off with your guess, it's just the parameter is ignored "by accident" when launching a single node.

I think this is confusing, and if someone tries to launch a single-node system from scratch, but with -raft-non-voter=true they are almost certainly confused. I'm going to change the code and have rqlited exit if asked to start in this meaningless configuration.

2 similar comments
@otoolep
Copy link
Member

otoolep commented Mar 27, 2023

I looked at the code to refresh my memory.

Operating as a "read-only node" (non-voting) is a cluster-joining -time thing. If you're not joining a cluster, and have no pre-existing state, the raft-non-voter is ignored and the node comes up as a single-node system. You weren't far off with your guess, it's just the parameter is ignored "by accident" when launching a single node.

I think this is confusing, and if someone tries to launch a single-node system from scratch, but with -raft-non-voter=true they are almost certainly confused. I'm going to change the code and have rqlited exit if asked to start in this meaningless configuration.

@otoolep
Copy link
Member

otoolep commented Mar 27, 2023

I looked at the code to refresh my memory.

Operating as a "read-only node" (non-voting) is a cluster-joining -time thing. If you're not joining a cluster, and have no pre-existing state, the raft-non-voter is ignored and the node comes up as a single-node system. You weren't far off with your guess, it's just the parameter is ignored "by accident" when launching a single node.

I think this is confusing, and if someone tries to launch a single-node system from scratch, but with -raft-non-voter=true they are almost certainly confused. I'm going to change the code and have rqlited exit if asked to start in this meaningless configuration.

@wellescastro
Copy link
Author

Oh ok, thanks for the enlightenment.

I think this is confusing, and if someone tries to launch a single-node system from scratch, but with -raft-non-voter=true they are almost certainly confused. I'm going to change the code and have rqlited exit if asked to start in this meaningless configuration.

I believe the change makes sense. Since I opened this issue just as a question, should I close it? thanks one more time.

@otoolep
Copy link
Member

otoolep commented Mar 27, 2023

I'll close it once I make the code change.

@otoolep
Copy link
Member

otoolep commented Mar 27, 2023

rqlited will now exit with this error if an attempt is made to launch a brand-new, standalone node, which isn't also instructed to join an existing cluster:

[rqlited] 2023/03/27 10:03:00 clustering failure: cannot create a new non-voting node without joining it to an existing cluster

@otoolep otoolep linked a pull request Mar 27, 2023 that will close this issue
@otoolep
Copy link
Member

otoolep commented Mar 27, 2023

I don't think this issue warrants an immediate release, so the change will be in the next release.

Thanks for your help improving rqlite.

@wellescastro
Copy link
Author

That's great, my pleasure. Thanks for quickly tackling this case.

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 a pull request may close this issue.

2 participants