[#1143] shard: Support degraded mode in Get
and GetRange
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
f058cead8f
commit
68903c9fd9
1 changed files with 9 additions and 6 deletions
|
@ -122,7 +122,15 @@ func (s *Shard) fetchObjectData(addr *addressSDK.Address, skipMeta bool, big, sm
|
|||
}
|
||||
}
|
||||
|
||||
if skipMeta {
|
||||
var exists bool
|
||||
if !skipMeta {
|
||||
exists, err = meta.Exists(s.metaBase, addr)
|
||||
if err != nil && s.GetMode() != ModeDegraded {
|
||||
return res, false, err
|
||||
}
|
||||
}
|
||||
|
||||
if skipMeta || err != nil {
|
||||
res, err = small(s.blobStor, nil)
|
||||
if err == nil || errors.Is(err, object.ErrRangeOutOfBounds) {
|
||||
return res, false, err
|
||||
|
@ -131,11 +139,6 @@ func (s *Shard) fetchObjectData(addr *addressSDK.Address, skipMeta bool, big, sm
|
|||
return res, false, err
|
||||
}
|
||||
|
||||
exists, err := meta.Exists(s.metaBase, addr)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
if !exists {
|
||||
var errNotFound apistatus.ObjectNotFound
|
||||
|
||||
|
|
Loading…
Reference in a new issue