[#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 <p.karpy@yadro.com>
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Pavel Karpy 2023-01-09 21:36:33 +03:00 committed by fyrchik
parent 554b85411f
commit 1d21b1e3e8
2 changed files with 15 additions and 1 deletions

View file

@ -6,6 +6,7 @@ Changelog for FrostFS Node
### Added ### Added
### Changed ### Changed
### Fixed ### Fixed
- Big object removal with non-local parts (#1978)
### Removed ### Removed
### Updated ### Updated
- `neo-go` to `v0.100.1` - `neo-go` to `v0.100.1`

View file

@ -11,6 +11,7 @@ import (
clientcore "github.com/TrueCloudLab/frostfs-node/pkg/core/client" clientcore "github.com/TrueCloudLab/frostfs-node/pkg/core/client"
"github.com/TrueCloudLab/frostfs-node/pkg/network" "github.com/TrueCloudLab/frostfs-node/pkg/network"
"github.com/TrueCloudLab/frostfs-sdk-go/client" "github.com/TrueCloudLab/frostfs-sdk-go/client"
"github.com/TrueCloudLab/frostfs-sdk-go/object"
) )
type singleClient struct { type singleClient struct {
@ -149,8 +150,12 @@ func (x *multiClient) iterateClients(ctx context.Context, f func(clientcore.Clie
err = f(c) 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) { if success || firstErr == nil || errors.Is(firstErr, errRecentlyFailed) {
firstErr = err firstErr = err
} }
@ -170,6 +175,14 @@ func (x *multiClient) ReportError(err error) {
return 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 // Dropping all clients here is not necessary, we do this
// because `multiClient` doesn't yet provide convenient interface // because `multiClient` doesn't yet provide convenient interface
// for reporting individual errors for streaming operations. // for reporting individual errors for streaming operations.