[lxc-devel] [lxd/master] Promote nodes if for whatever reason the n of voters drop below 3

freeekanayaka on Github lxc-bot at linuxcontainers.org
Tue Mar 3 08:53:32 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200303/1a1adf72/attachment.bin>
-------------- next part --------------
From f82a632a3c77eef2594d9df93324824eb9d08c16 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Tue, 3 Mar 2020 09:52:23 +0100
Subject: [PATCH] Promote nodes if for whatever reason the n of voters drop
 below 3

Signed-off-by: Free Ekanayaka <free.ekanayaka at canonical.com>
---
 lxd/cluster/membership.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/cluster/membership.go b/lxd/cluster/membership.go
index 63477ab581..57d8e910e8 100644
--- a/lxd/cluster/membership.go
+++ b/lxd/cluster/membership.go
@@ -573,7 +573,7 @@ func Rebalance(state *state.State, gateway *Gateway) (string, []db.RaftNode, err
 
 	var role db.RaftRole
 
-	if len(voters) < int(maxVoters) && len(voters) > 1 {
+	if len(voters) < int(maxVoters) && len(currentRaftNodes) >= 3 {
 		role = db.RaftVoter
 		// Include stand-by nodes among the ones that can be promoted,
 		// preferring them over spare ones.


More information about the lxc-devel mailing list