hn.today

Just Because You Can, Doesn't Mean You Should: Re-Evaluating Galera Node Weights

percona.com7 points0 comments
Screenshot of Just Because You Can, Doesn't Mean You Should: Re-Evaluating Galera Node Weights

Galera clusters use quorum to decide which connected group forms the Primary Component, the only group allowed to process transactions. When membership changes, nodes agree on a new cluster view and compare the votes of its surviving members with the previous view; a group without a strict majority stops accepting work to prevent split-brain corruption. The `pc.weight` setting lets administrators assign different voting weights, so an even number of nodes can sometimes avoid a tied vote. But weights must be designed for every possible membership change, not just the initial cluster: an unsuitable assignment can let one node keep the cluster running alone or leave the whole cluster without a Primary Component.

The key factor is the parity of the total voting weight in the current Primary Component, not the number of nodes. Five equal-weight nodes avoid an exact tie in a two-way split, and six nodes can do the same if one has weight two, but an odd number of nodes can still tie if their total weight is even. Failures and graceful shutdowns change membership and can make the remaining weight even; multiway partitions can also leave every group without a majority. Odd node counts do not increase failure tolerance: five and six nodes both survive at most two failures. For multi-datacenter deployments, a third location or Galera Arbitrator can help maintain quorum. The practical advice is to aim for odd total weight, while recognizing that no weighting scheme eliminates every risk, especially after a cluster shrinks.

Read on percona.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.