Skip to content

metabase: put batch during resync metabase#3804

Merged
roman-khimov merged 1 commit intomasterfrom
3453-speed-up-metabase-resync-process
Feb 11, 2026
Merged

metabase: put batch during resync metabase#3804
roman-khimov merged 1 commit intomasterfrom
3453-speed-up-metabase-resync-process

Conversation

@End-rey
Copy link
Contributor

@End-rey End-rey commented Feb 9, 2026

Closes #3453.

@End-rey End-rey self-assigned this Feb 9, 2026
@End-rey End-rey force-pushed the 3453-speed-up-metabase-resync-process branch from c0ea8c6 to d5c1991 Compare February 9, 2026 20:28
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 86.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.55%. Comparing base (dea6fad) to head (39c9f7f).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/local_object_storage/shard/control.go 78.94% 2 Missing and 2 partials ⚠️
pkg/local_object_storage/metabase/put.go 90.32% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3804      +/-   ##
==========================================
+ Coverage   25.51%   25.55%   +0.04%     
==========================================
  Files         664      668       +4     
  Lines       42689    42889     +200     
==========================================
+ Hits        10892    10961      +69     
- Misses      30794    30924     +130     
- Partials     1003     1004       +1     

☔ 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.

Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

Seems good.

@End-rey End-rey force-pushed the 3453-speed-up-metabase-resync-process branch from d5c1991 to 9c8a179 Compare February 10, 2026 15:47
@End-rey End-rey force-pushed the 3453-speed-up-metabase-resync-process branch from 9c8a179 to 31aa82f Compare February 10, 2026 17:04
@End-rey End-rey requested a review from roman-khimov February 10, 2026 17:07
@End-rey End-rey force-pushed the 3453-speed-up-metabase-resync-process branch from 31aa82f to 39c9f7f Compare February 11, 2026 07:05
Doing `Put()` for every object is problematic on its own because it's a BoltDB
`Batch()` for every object and in absence of concurrent modifications this means
`max_batch_delay` for every object. So rework transaction handling for the
resync case, open a transaction, process 1K objects, flush the transaction,
rinse, repeat.

```
goos: linux
goarch: amd64
pkg: github.com/nspcc-dev/neofs-node/pkg/local_object_storage/metabase
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkPutBatch
BenchmarkPutBatch/batch_size_1
BenchmarkPutBatch/batch_size_1-16         	     589	   2287473 ns/op	       437.2 objects/sec	  276274 B/op	     756 allocs/op
BenchmarkPutBatch/batch_size_10
BenchmarkPutBatch/batch_size_10-16        	    2960	    838220 ns/op	      1193 objects/sec	  221012 B/op	     702 allocs/op
BenchmarkPutBatch/batch_size_100
BenchmarkPutBatch/batch_size_100-16       	    5220	    405635 ns/op	      2465 objects/sec	  132055 B/op	     564 allocs/op
BenchmarkPutBatch/batch_size_1000
BenchmarkPutBatch/batch_size_1000-16      	    5659	    631707 ns/op	      1583 objects/sec	   60497 B/op	     559 allocs/op
BenchmarkPutBatch/individual_puts
BenchmarkPutBatch/individual_puts-16      	      96	  12830332 ns/op	        77.94 objects/sec	  200998 B/op	     538 allocs/op
PASS
```

Closes #3453.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
@roman-khimov roman-khimov merged commit 7532979 into master Feb 11, 2026
17 of 19 checks passed
@roman-khimov roman-khimov deleted the 3453-speed-up-metabase-resync-process branch February 11, 2026 07:15
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.

Speed up metabase resync process

3 participants