-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change WC
size estimations
#3106
Conversation
Refs #3076. Signed-off-by: Andrey Butusov <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3106 +/- ##
==========================================
+ Coverage 22.33% 22.39% +0.05%
==========================================
Files 751 751
Lines 58028 58039 +11
==========================================
+ Hits 12962 12999 +37
+ Misses 44181 44149 -32
- Partials 885 891 +6 ☔ View full report in Codecov by Sentry. |
We will. It allows to answer |
cacheSz := c.estimateCacheSize() | ||
if c.maxCacheSize < c.incSizeFS(cacheSz) { | ||
cacheSz := c.objCounters.Size() | ||
objSz := obj.obj.PayloadSize() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object is a bit bigger than its payload. But if can't get its size easily it should be OK this way.
if c.maxCacheSize < c.incSizeFS(cacheSz) { | ||
cacheSz := c.objCounters.Size() | ||
objSz := obj.obj.PayloadSize() | ||
if c.maxCacheSize < cacheSz+objSz { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can go slightly above the limit due to concurrency. Also likely not a bit issue.
} | ||
|
||
func (c *cache) initCounters() error { | ||
inFS, err := c.fsTree.NumberOfObjects() | ||
var objHandler = func(addr oid.Address, data []byte, _ []byte) error { | ||
c.objCounters.Add(addr, uint64(len(data))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice that you're using full object size here.
Now size of write-cache is a sum of every object currently stored in WS. Closes #3101. Signed-off-by: Andrey Butusov <[email protected]>
c7b910d
to
dfe2711
Compare
If I understand you correctly, I added a new |
|
Closes #3101.
Why are we doing this? We don't use it anywhere, do we?
Also, I forgot to include tests for migration from #3091, so I did it here.