[#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>
remotes/fyrchik/prometheus-epoch
Leonard Lyubich 2021-12-09 15:30:45 +03:00 committed by Alex Vanin
parent d246e5193b
commit fc42844fbf
1 changed files with 7 additions and 0 deletions

View File

@ -116,6 +116,8 @@ func (c *cache) flushBigObjects() {
for {
select {
case <-tick.C:
evictNum := 0
_ = c.fsTree.Iterate(func(addr *objectSDK.Address, data []byte) error {
sAddr := addr.String()
@ -131,8 +133,13 @@ func (c *cache) flushBigObjects() {
// mark object as flushed
c.store.flushed.Add(sAddr, false)
evictNum++
return nil
})
// evict objects which were successfully written to BlobStor
c.evictObjects(evictNum)
case <-c.closeCh:
}
}