[#1969] local_object_storage: Add a type for logical errors
All logic errors are wrapped in `logicerr.Logical` type and do not affect shard error counter. Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
98034005f1
commit
fcdbf5e509
42 changed files with 206 additions and 139 deletions
|
@ -77,8 +77,8 @@ func (e *StorageEngine) delete(prm DeletePrm) (DeleteRes, error) {
|
|||
return true
|
||||
}
|
||||
|
||||
splitErr, ok := err.(*objectSDK.SplitInfoError)
|
||||
if !ok {
|
||||
var splitErr *objectSDK.SplitInfoError
|
||||
if !errors.As(err, &splitErr) {
|
||||
if !shard.IsErrNotFound(err) {
|
||||
e.reportShardError(sh, "could not check object existence", err)
|
||||
}
|
||||
|
@ -97,13 +97,7 @@ func (e *StorageEngine) delete(prm DeletePrm) (DeleteRes, error) {
|
|||
|
||||
_, err = sh.Inhume(shPrm)
|
||||
if err != nil {
|
||||
if errors.Is(err, shard.ErrReadOnlyMode) || errors.Is(err, shard.ErrDegradedMode) {
|
||||
e.log.Warn("could not inhume object in shard",
|
||||
zap.Stringer("shard_id", sh.ID()),
|
||||
zap.String("error", err.Error()))
|
||||
} else {
|
||||
e.reportShardError(sh, "could not inhume object in shard", err)
|
||||
}
|
||||
e.reportShardError(sh, "could not inhume object in shard", err)
|
||||
|
||||
locked.is = errors.As(err, &locked.err)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue