[lxc-devel] [lxd/master] lxd/cluster: If raft node 1 gets remove during recovery, add it back

freeekanayaka on Github lxc-bot at linuxcontainers.org
Tue Jun 23 10:18:23 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 515 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200623/1e747b22/attachment.bin>
-------------- next part --------------
From 7e2b027ae4c88309b05cfc3551363adf71501e87 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Tue, 23 Jun 2020 12:16:09 +0200
Subject: [PATCH] lxd/cluster: If raft node 1 gets remove during recovery, add
 it back

When running lxd cluster recover-from-quorum-loss, if your raft node 1 is still
around it wasn't added back to the raft configuration after recovery.

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

diff --git a/lxd/cluster/upgrade.go b/lxd/cluster/upgrade.go
index b6704b65b3..4625da0174 100644
--- a/lxd/cluster/upgrade.go
+++ b/lxd/cluster/upgrade.go
@@ -142,7 +142,7 @@ func upgradeMembersWithoutRole(gateway *Gateway, members []db.NodeInfo, nodes []
 	for _, member := range members {
 		found := false
 		for _, node := range nodes {
-			if member.ID == 1 || member.Address == node.Address {
+			if member.ID == 1 && node.ID == 1 || member.Address == node.Address {
 				found = true
 				break
 			}


More information about the lxc-devel mailing list