From 2d0b300aea18aadc0555886b1e53ad197ea7e411 Mon Sep 17 00:00:00 2001 From: Phan Le Date: Thu, 6 Apr 2023 16:35:23 -0700 Subject: [PATCH] Fix bug: volume is stuck in live engine upgrading The only usecase of ProcessReplace is for engine image live upgrade. If the new engine process has the same binary as the existing engine process, there is no reason to do the ProcessReplace longhorn-5684 Signed-off-by: Phan Le (cherry picked from commit 16b8bf34d38dfaf418c7c7e48de50ea1f50528d7) --- pkg/process/process_manager.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/process/process_manager.go b/pkg/process/process_manager.go index 8ebc91a32..a8d4fba09 100644 --- a/pkg/process/process_manager.go +++ b/pkg/process/process_manager.go @@ -457,6 +457,11 @@ func (pm *Manager) ProcessReplace(ctx context.Context, req *rpc.ProcessReplaceRe return nil, err } + if processToReplace.Binary == p.Binary { + logrus.Infof("Process Manager: the existing process already has the updated engine image %v", p.Binary) + return processToReplace.RPCResponse(), nil + } + cleanupReplacementProcess := func() { // TODO process ports should be tied to process UUID's right now only the port ranges is used // so if one is not careful with allocation/release it's possible that different processes nuke each