[#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>
remotes/carpawell/fix/multiple-cache-update-requests-FROST
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
### Changed
### Fixed
- Big object removal with non-local parts (#1978)
### Removed
### Updated
- `neo-go` to `v0.100.1`

View File

@ -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.