Skip to content

Commit

Permalink
metabase: ignore lacking split info and not found on Put
Browse files Browse the repository at this point in the history
Fix resynchronization failure:

   2024/12/02 20:01:33 init shard CAXqYYjUEAbdr8gcLFgrpa: could not initialize *shard.metabaseSynchronizer: could not put objects to the meta from blobstor: blobstor iterator failure: exec read-only BoltDB transaction: logical error: no split info on parent object

In general, exists() call shouldn't affect Put() much.

Signed-off-by: Roman Khimov <[email protected]>
  • Loading branch information
roman-khimov committed Dec 3, 2024
1 parent 7e020e1 commit c0d303c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog for NeoFS Node

### Fixed
- Fail gracefully on error from config validation (#3037)
- Metabase resynchronization failure (#3039)

### Changed

Expand Down
10 changes: 7 additions & 3 deletions pkg/local_object_storage/metabase/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
objectCore "github.com/nspcc-dev/neofs-node/pkg/core/object"
storagelog "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/internal/log"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/util"
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
"go.etcd.io/bbolt"
Expand Down Expand Up @@ -72,10 +73,13 @@ func (db *DB) put(

exists, err := db.exists(tx, objectCore.AddressOf(obj), currEpoch)

if errors.As(err, &splitInfoError) {
switch {
case errors.As(err, &splitInfoError):
exists = true // object exists, however it is virtual
} else if err != nil {
return err // return any error besides SplitInfoError
case errors.Is(err, ErrLackSplitInfo), errors.As(err, &apistatus.ObjectNotFound{}):

Check warning on line 79 in pkg/local_object_storage/metabase/put.go

View check run for this annotation

Codecov / codecov/patch

pkg/local_object_storage/metabase/put.go#L79

Added line #L79 was not covered by tests
// OK, we're putting here.
case err != nil:
return err // return any other errors

Check warning on line 82 in pkg/local_object_storage/metabase/put.go

View check run for this annotation

Codecov / codecov/patch

pkg/local_object_storage/metabase/put.go#L81-L82

Added lines #L81 - L82 were not covered by tests
}

// most right child and split header overlap parent so we have to
Expand Down

0 comments on commit c0d303c

Please sign in to comment.