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
|
@ -5,6 +5,7 @@ import (
|
|||
"errors"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard"
|
||||
"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"
|
||||
|
@ -19,7 +20,7 @@ func (e *StorageEngine) exists(ctx context.Context, addr oid.Address) (bool, err
|
|||
e.iterateOverSortedShards(addr, func(_ int, sh hashedShard) (stop bool) {
|
||||
res, err := sh.Exists(ctx, shPrm)
|
||||
if err != nil {
|
||||
if shard.IsErrRemoved(err) {
|
||||
if client.IsErrObjectAlreadyRemoved(err) {
|
||||
alreadyRemoved = true
|
||||
|
||||
return true
|
||||
|
@ -34,7 +35,7 @@ func (e *StorageEngine) exists(ctx context.Context, addr oid.Address) (bool, err
|
|||
return true
|
||||
}
|
||||
|
||||
if !shard.IsErrNotFound(err) {
|
||||
if !client.IsErrObjectNotFound(err) {
|
||||
e.reportShardError(sh, "could not check existence of object in shard", err)
|
||||
}
|
||||
return false
|
||||
|
@ -48,9 +49,7 @@ func (e *StorageEngine) exists(ctx context.Context, addr oid.Address) (bool, err
|
|||
})
|
||||
|
||||
if alreadyRemoved {
|
||||
var errRemoved apistatus.ObjectAlreadyRemoved
|
||||
|
||||
return false, errRemoved
|
||||
return false, new(apistatus.ObjectAlreadyRemoved)
|
||||
}
|
||||
|
||||
return exists, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue