From f98efb333f89b8493c55b91698c917437b7af310 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 25 Dec 2024 21:04:13 +0400 Subject: [PATCH] fix: ignore member not found error on leave cluster Fixes #10040 Sometimes etcd after 'server stoppped' error actually removes a member, so the next attempt returns member not found, ignore it, as our goal was to remove a member. Signed-off-by: Andrey Smirnov --- internal/pkg/etcd/etcd.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/pkg/etcd/etcd.go b/internal/pkg/etcd/etcd.go index 4589de5903..43dc079b39 100644 --- a/internal/pkg/etcd/etcd.go +++ b/internal/pkg/etcd/etcd.go @@ -171,6 +171,11 @@ func (c *Client) LeaveCluster(ctx context.Context, st state.State) error { return retry.ExpectedError(err) } + if errors.Is(err, rpctypes.ErrMemberNotFound) { + // already removed, nothing to do + return nil + } + return err }); err != nil { return err