From b43e6d77b78624b3385151725e3203c34b897076 Mon Sep 17 00:00:00 2001 From: anonpenguin23 Date: Mon, 2 Feb 2026 09:19:02 +0200 Subject: [PATCH] Fixed zombie rqlite on upgrade --- pkg/rqlite/process.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pkg/rqlite/process.go b/pkg/rqlite/process.go index 9d1a947..61c6cff 100644 --- a/pkg/rqlite/process.go +++ b/pkg/rqlite/process.go @@ -90,17 +90,8 @@ func (r *RQLiteManager) launchProcess(ctx context.Context, rqliteDataDir string) } } - if r.config.RQLiteJoinAddress != "" { - r.logger.Info("Joining RQLite cluster", zap.String("join_address", r.config.RQLiteJoinAddress)) - - peersJSONPath := filepath.Join(rqliteDataDir, "raft", "peers.json") - if _, err := os.Stat(peersJSONPath); err == nil { - r.logger.Info("Removing existing peers.json before joining cluster", - zap.String("path", peersJSONPath)) - if err := os.Remove(peersJSONPath); err != nil { - r.logger.Warn("Failed to remove peers.json", zap.Error(err)) - } - } + if r.config.RQLiteJoinAddress != "" && !r.hasExistingState(rqliteDataDir) { + r.logger.Info("First-time join to RQLite cluster", zap.String("join_address", r.config.RQLiteJoinAddress)) joinArg := r.config.RQLiteJoinAddress if strings.HasPrefix(joinArg, "http://") {