Skip to content

Commit

Permalink
node/metabase: Don't create parent index from the 1st child on migration
Browse files Browse the repository at this point in the history
Should have been done in bd36f5b.
First child in object split V2 scheme contains incomplete parent header.
Previously, following error could occur during v3->v4 metabase migration:
```
put metadata for parent of object <OID>: missing payload checksum
```

This makes corresponding migration func to skip parent header from the
1st child as `Put` does.

Refs #3058.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Feb 28, 2025
1 parent 89621cf commit b3dbd94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Changelog for NeoFS Node
- Zero range denial by `neofs-cli object range|hash` commands (#3182)
- Not all the components needed for write-cache migration were initialized (#3186)
- Homomorphic hash indexes with empty values in meta bucket (#3187)
- Failure of 1st split-chain child processing during metabase migration (#3187)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion pkg/local_object_storage/metabase/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func migrateFrom3Version(_ *DB, tx *bbolt.Tx) error {
if err := putMetadataForObject(tx, hdr, hasParent, true); err != nil {
return fmt.Errorf("put metadata for object %s: %w", id, err)
}
if hasParent {
if hasParent && !par.GetID().IsZero() { // skip the first object without useful info similar to DB.put
if err := putMetadataForObject(tx, *par, false, false); err != nil {
return fmt.Errorf("put metadata for parent of object %s: %w", id, err)
}
Expand Down

0 comments on commit b3dbd94

Please sign in to comment.