forked from TrueCloudLab/frostfs-node
[#1028] writecache: Evict flushed big objects
Make `flushBigObjects` routine to call `evictObjects` which was successfully written to `BlobStor`. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
d246e5193b
commit
fc42844fbf
1 changed files with 7 additions and 0 deletions
|
@ -116,6 +116,8 @@ func (c *cache) flushBigObjects() {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-tick.C:
|
case <-tick.C:
|
||||||
|
evictNum := 0
|
||||||
|
|
||||||
_ = c.fsTree.Iterate(func(addr *objectSDK.Address, data []byte) error {
|
_ = c.fsTree.Iterate(func(addr *objectSDK.Address, data []byte) error {
|
||||||
sAddr := addr.String()
|
sAddr := addr.String()
|
||||||
|
|
||||||
|
@ -131,8 +133,13 @@ func (c *cache) flushBigObjects() {
|
||||||
// mark object as flushed
|
// mark object as flushed
|
||||||
c.store.flushed.Add(sAddr, false)
|
c.store.flushed.Add(sAddr, false)
|
||||||
|
|
||||||
|
evictNum++
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// evict objects which were successfully written to BlobStor
|
||||||
|
c.evictObjects(evictNum)
|
||||||
case <-c.closeCh:
|
case <-c.closeCh:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue