mirror of
https://github.com/nspcc-dev/neofs-node.git
synced 2026-03-01 04:29:10 +00:00
Fix WC size estimations #1323
Labels
No labels
I1
I2
I3
I4
S0
S1
S2
S3
S4
U0
U1
U2
U3
U4
blocked
bug
config
dependencies
discussion
documentation
enhancement
enhancement
epic
feature
go
good first issue
help wanted
neofs-adm
neofs-cli
neofs-cli
neofs-cli
neofs-ir
neofs-lens
neofs-storage
neofs-storage
performance
question
security
task
test
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-node#1323
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @carpawell on GitHub (Jan 29, 2025).
Originally assigned to: @End-rey on GitHub.
Currently, its size (to control cache size and not overflow) is defined as
numOfObjs*theBiggestPossibleObj. It is not precise at all. It was done mostly because of uncontrollable bbolt db size for small objects. But there is no bbolt db in WC now: https://github.com/nspcc-dev/neofs-node/pull/3091Expected Behavior
Taken space is smth like a sum of every object that is currently stored in WC.
Current Behavior
Taken space is a magic product:
nspcc-dev/neofs-node@25314f58cb/pkg/local_object_storage/writecache/state.go (L11-L13).Possible Solution
Store the sum from
Expected Behaviorand change it accordingly with every PUT and DELETE.Steps to Reproduce (for bugs)
Look at
nspcc-dev/neofs-node@25314f58cb/pkg/local_object_storage/writecache/state.go (L11-L13).Context
https://github.com/nspcc-dev/neofs-node/pull/3091#pullrequestreview-2580795118
Regression
No.
Your Environment
v0.44.2.
@roman-khimov commented on GitHub (Jan 31, 2025):
Keep object list in memory along with sizes (map address to size), then have an atomic variable with overall size. Add to both when storing, subtract when flushing.
@roman-khimov commented on GitHub (Jan 31, 2025):
Or maybe not an atomic var since we'll have to lock the map anyway.