In a MariaDB Galera cluster, you can assign a weight to each node, from 0-255. However, the documentation does not specify if this is allowed to be a decimal number (like 1.5). In other areas, it does specify when something must be an integer, leading me to believe it might allow decimals for this value.
Does the config allow non-integer numbers to be assigned to this weight? When I assign non-integer weights, no error or warning is generated. However, I haven't tested to see if the weights actually take into account any non-integer value.
For example, if I had 4 nodes, with 2.1, 2.2, 2.4, and 2.8 weights assigned, and then two nodes split off from the other two, would the weighted quorum calculation correctly find a quorum with the two nodes that had slightly higher weight totals? Or would it only calculate each node as if they had a weight of 2, resulting in a split brain?
I asked a question on math.se to find a general way to calculate unique weights that will never create a split-brain. However, the specific galera documentation says the highest weight is limited to 255, meaning the formula provided in the answer will only reasonably allow for 8 nodes (weights) that meet my criteria. But if decimal values are allowed, the formula could be generalized for a much larger number of nodes.
Example: With 9 servers, each node could be given a weight of 256, 257, 259, 263, 271, 287, 319, 383, 511 (which is (255+2^(n-1))). It is impossible to get any set of those numbers to add up to 50% of the whole group or any subset of the group, meaning no split brain possibility exists. Since the documentation only allows values up to 255, just multiply all of those by 0.1. But if the documentation only allows integers, the calculation is limited to 8 servers and a formula of (127+(2^(n-1)).