Metabase batching with buckets cache #1694

Open
opened 2025-03-21 07:14:47 +00:00 by dstepanov-yadro · 0 comments

In #1688 and #1686 search for objects in the metabase was optimized by caching buckets within a single transaction. It is proposed to make the same optimization for write batching.

Describe the solution you'd like

Add new method in metabase (CustomBatch, BatchWithCache, Batch2, BatchEx - I'm not good at naming :( ) with signature func (db *DB) BatchEx(fn func(*bucketCache, *Tx) error) error with the same logic as 914ccefafb/db.go (L966) but use one bucketCache for all db.batch.calls.
Replace db.boltDB.Batch calls with new method calls.
Check if this will lead to better write performance.

## Is your feature request related to a problem? Please describe. In https://git.frostfs.info/TrueCloudLab/frostfs-node/pulls/1688 and https://git.frostfs.info/TrueCloudLab/frostfs-node/pulls/1686 search for objects in the metabase was optimized by caching buckets within a single transaction. It is proposed to make the same optimization for write batching. ## Describe the solution you'd like Add new method in metabase (`CustomBatch`, `BatchWithCache`, `Batch2`, `BatchEx` - I'm not good at naming :( ) with signature `func (db *DB) BatchEx(fn func(*bucketCache, *Tx) error) error ` with the same logic as https://github.com/etcd-io/bbolt/blob/914ccefafb7fa4dd809971b448515717142d9041/db.go#L966 but use one bucketCache for all `db.batch.calls`. Replace `db.boltDB.Batch` calls with new method calls. Check if this will lead to better write performance.
dstepanov-yadro added the
enhancement
frostfs-node
triage
perfomance
internal
labels 2025-03-21 07:14:47 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1694
No description provided.