Skip to content

Commit 8dffd53

Browse files
committed
node/metabase: Provide API for SearchV2
There is a need to serve `ObjectService.SearchV2` RPC by the SN. In order not to expand the structure and configuration of the node, the best place to store metadata is metabase. Metabases are extended with per-container object metadata buckets. For each object, following indexes are created: - OID; - attribute->OID; - OID->attribute. Integers are stored specifically to reach lexicographic comparisons without decoding. New `Search` method is provided: it allows to filter out container's objects and receive specified attributes. Count is also limited, op is paged via cursor. In other words, the method follows SearchV2 behavior within single metabase. Refs #3058.
1 parent 5279df2 commit 8dffd53

File tree

7 files changed

+2259
-2
lines changed

7 files changed

+2259
-2
lines changed

pkg/local_object_storage/metabase/containers.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ func (db *DB) DeleteContainer(cID cid.ID) error {
184184
return fmt.Errorf("link objects' bucket cleanup: %w", err)
185185
}
186186

187+
// Metadata
188+
if err = tx.DeleteBucket(metaBucketKey(cID)); err != nil && !errors.Is(err, bbolt.ErrBucketNotFound) {
189+
return fmt.Errorf("metadata bucket cleanup: %w", err)
190+
}
191+
187192
// indexes
188193

189194
err = tx.DeleteBucket(ownerBucketName(cID, buff))

0 commit comments

Comments
 (0)