Skip to content

Commit

Permalink
fix: ignore member not found error on leave cluster
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit f98efb3)
  • Loading branch information
smira committed Dec 26, 2024
1 parent 2125206 commit e702542
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/pkg/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e702542

Please sign in to comment.