forked from TrueCloudLab/frostfs-node
[#481] Update frostfs-sdk-go and error pointer receivers
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
parent
de3d1eb99c
commit
5b7e4a51b7
77 changed files with 265 additions and 313 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/util"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/util/logicerr"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-observability/tracing"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
||||
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
|
||||
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
||||
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
||||
|
@ -74,11 +75,9 @@ func (e *StorageEngine) head(ctx context.Context, prm HeadPrm) (HeadRes, error)
|
|||
var (
|
||||
head *objectSDK.Object
|
||||
siErr *objectSDK.SplitInfoError
|
||||
outSI *objectSDK.SplitInfo
|
||||
|
||||
errNotFound apistatus.ObjectNotFound
|
||||
|
||||
outSI *objectSDK.SplitInfo
|
||||
outError error = errNotFound
|
||||
outError error = new(apistatus.ObjectNotFound)
|
||||
)
|
||||
|
||||
var shPrm shard.HeadPrm
|
||||
|
@ -89,7 +88,7 @@ func (e *StorageEngine) head(ctx context.Context, prm HeadPrm) (HeadRes, error)
|
|||
res, err := sh.Head(ctx, shPrm)
|
||||
if err != nil {
|
||||
switch {
|
||||
case shard.IsErrNotFound(err):
|
||||
case client.IsErrObjectNotFound(err):
|
||||
return false // ignore, go to next shard
|
||||
case errors.As(err, &siErr):
|
||||
if outSI == nil {
|
||||
|
@ -107,16 +106,14 @@ func (e *StorageEngine) head(ctx context.Context, prm HeadPrm) (HeadRes, error)
|
|||
}
|
||||
|
||||
return false
|
||||
case shard.IsErrRemoved(err):
|
||||
case client.IsErrObjectAlreadyRemoved(err):
|
||||
outError = err
|
||||
|
||||
return true // stop, return it back
|
||||
case shard.IsErrObjectExpired(err):
|
||||
var notFoundErr apistatus.ObjectNotFound
|
||||
|
||||
// object is found but should not
|
||||
// be returned
|
||||
outError = notFoundErr
|
||||
outError = new(apistatus.ObjectNotFound)
|
||||
|
||||
return true
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue