Skip to content

Improved metabase interfaces for group-addressed operations#3933

Open
roman-khimov wants to merge 3 commits intomasterfrom
meta-oid-slices
Open

Improved metabase interfaces for group-addressed operations#3933
roman-khimov wants to merge 3 commits intomasterfrom
meta-oid-slices

Conversation

@roman-khimov
Copy link
Copy Markdown
Member

Simplify metabase internals, fix some existing and potential bugs.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 62.85714% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.78%. Comparing base (543f7cd) to head (9bbbf09).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
cmd/neofs-lancet/internal/meta/remove.go 0.00% 22 Missing ⚠️
pkg/local_object_storage/metabase/inhume.go 67.64% 7 Missing and 4 partials ⚠️
pkg/local_object_storage/shard/gc.go 57.69% 7 Missing and 4 partials ⚠️
pkg/local_object_storage/metabase/delete.go 77.77% 5 Missing and 1 partial ⚠️
pkg/local_object_storage/engine/inhume.go 71.42% 4 Missing ⚠️
pkg/local_object_storage/metabase/graveyard.go 80.95% 3 Missing and 1 partial ⚠️
pkg/local_object_storage/engine/delete.go 50.00% 2 Missing ⚠️
pkg/local_object_storage/shard/delete.go 83.33% 2 Missing ⚠️
pkg/local_object_storage/engine/put.go 0.00% 1 Missing ⚠️
pkg/local_object_storage/shard/inhume.go 85.71% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3933      +/-   ##
==========================================
- Coverage   26.83%   26.78%   -0.05%     
==========================================
  Files         670      670              
  Lines       44372    44360      -12     
==========================================
- Hits        11906    11884      -22     
- Misses      31355    31365      +10     
  Partials     1111     1111              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return fmt.Errorf("can't remove objects: %w", err)
}
for _, r := range res.RemovedObjects {
cmd.Println("Removed:", r.ID.String())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cmd.Println("Removed:", r.ID.String())
cmd.Println("Removed: ", r.ID.String())

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Println adds a separator by itself.

addr.SetContainer(cID)

res := make([]oid.Address, 0, len(mm))
func measuredObjsToAddresses(cID cid.ID, mm []object.MeasuredObject) []oid.ID {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not return addresses now

}

// mergeOIDs merges given set of lists of object IDs into a single flat
// list of addresses in the same given container. ids are expected to be
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not addresses now

cnrMetaBktKey[0] = metadataPrefix

res := make([]RemovedObject, len(addrs))
func supplementRemovedObjects(cur *bbolt.Cursor, addrs []oid.ID) ([]RemovedObject, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not addrs. below too

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some addrs are variable names.

@@ -66,23 +73,22 @@ func (db *DB) iterateIDs(c *bbolt.Cursor, h func(oid.ID) error, offset oid.ID) e
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed all of the outdated comments.

The only real user of random address lists is lancet, it can cope with that.
GC is semi-dependent on this, but that's an area for improvement. Otherwise
this change allows to seriously simplify some metabase logic. Fixes #3900.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
We even have a test for it.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants