forked from TrueCloudLab/frostfs-node
[#1985] blobstor: Allow to report multiple errors to caller
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
f2d7e65e39
commit
d65604ad30
10 changed files with 61 additions and 183 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobovnicza"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/common"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/compression"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/util/logicerr"
|
||||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -157,7 +158,7 @@ func (b *Blobovniczas) updateAndGet(p string, old *uint64) (blobovniczaWithIndex
|
|||
if ok {
|
||||
if old != nil {
|
||||
if active.ind == b.blzShallowWidth-1 {
|
||||
return active, errors.New("no more Blobovniczas")
|
||||
return active, logicerr.New("no more Blobovniczas")
|
||||
} else if active.ind != *old {
|
||||
// sort of CAS in order to control concurrent
|
||||
// updateActive calls
|
||||
|
@ -246,3 +247,8 @@ func (b *Blobovniczas) Path() string {
|
|||
func (b *Blobovniczas) SetCompressor(cc *compression.Config) {
|
||||
b.compression = cc
|
||||
}
|
||||
|
||||
// SetReportErrorFunc implements common.Storage.
|
||||
func (b *Blobovniczas) SetReportErrorFunc(f func(string, error)) {
|
||||
b.reportError = f
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue