forked from TrueCloudLab/frostfs-node
[#947] writecache: refactor object persisting
a1696a8
introduced some logic which in some situations prevented big objects
to be persisted in FSTree. In this commit a refactoring is done with the
goal of simplifying the code and also checking #866 issue.
1. Split a monstrous function into multiple simple ones: memory objects
can only be small and for writing through the cache we can do a dispatch
in `Put` itself.
2. Determine objects to be put in database before the actual update
as setting up a transaction has non-zero overhead.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
088c894f44
commit
1462824ab8
5 changed files with 56 additions and 114 deletions
|
@ -117,7 +117,6 @@ func (c *cache) deleteFromDB(keys [][]byte) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.dbSize.Sub(sz)
|
||||
c.objCounters.DecDB()
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue