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

Issues with two-node clusters #293

Open
cole-miller opened this issue Apr 4, 2024 · 0 comments
Open

Issues with two-node clusters #293

cole-miller opened this issue Apr 4, 2024 · 0 comments

Comments

@cole-miller
Copy link
Contributor

The MAAS and Juju teams have both run into trouble when operating two-node dqlite clusters. In both cases there's a desire for go-dqlite's automatic role management to support maintaining both nodes as voters in this situation; right now this is not possible due to the code here:

go-dqlite/app/roles.go

Lines 134 to 143 in 1940345

// If the cluster is too small, make sure we have just one voter (us).
if c.size() < minVoters {
for node := range c.State {
if node.ID == leader || node.Role != client.Voter {
continue
}
return client.Spare, []client.NodeInfo{node}
}
return -1, nil
}

You can't set the voter target to an even number. If you set it to 1 then the problem is obvious, and if you set it to 3 then this code still leads to having only one voter in a two-node cluster. We should fix this situation so that two-node clusters with two voters are viable with go-dqlite.

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

No branches or pull requests

1 participant