From 1d21b1e3e8802524a569542ffaae4c6e226ad44f Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 9 Jan 2023 21:36:33 +0300 Subject: [PATCH] [#1978] node: Do not drop clients on split errors After the reconnection interval feature there was an bug related to the big objects collecting: split error is returned from a client directly, not via API status and was considered as a connection error. Signed-off-by: Pavel Karpy Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 1 + pkg/network/cache/multi.go | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7c935db2..db69b5841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Changelog for FrostFS Node ### Added ### Changed ### Fixed +- Big object removal with non-local parts (#1978) ### Removed ### Updated - `neo-go` to `v0.100.1` diff --git a/pkg/network/cache/multi.go b/pkg/network/cache/multi.go index b251c5ce5..268945631 100644 --- a/pkg/network/cache/multi.go +++ b/pkg/network/cache/multi.go @@ -11,6 +11,7 @@ import ( clientcore "github.com/TrueCloudLab/frostfs-node/pkg/core/client" "github.com/TrueCloudLab/frostfs-node/pkg/network" "github.com/TrueCloudLab/frostfs-sdk-go/client" + "github.com/TrueCloudLab/frostfs-sdk-go/object" ) type singleClient struct { @@ -149,8 +150,12 @@ func (x *multiClient) iterateClients(ctx context.Context, f func(clientcore.Clie err = f(c) } - success := err == nil || errors.Is(err, context.Canceled) + // non-status logic error that could be returned + // from the SDK client; should not be considered + // as a connection error + var siErr *object.SplitInfoError + success := err == nil || errors.Is(err, context.Canceled) || errors.As(err, &siErr) if success || firstErr == nil || errors.Is(firstErr, errRecentlyFailed) { firstErr = err } @@ -170,6 +175,14 @@ func (x *multiClient) ReportError(err error) { return } + // non-status logic error that could be returned + // from the SDK client; should not be considered + // as a connection error + var siErr *object.SplitInfoError + if errors.As(err, &siErr) { + return + } + // Dropping all clients here is not necessary, we do this // because `multiClient` doesn't yet provide convenient interface // for reporting individual errors for streaming operations.