Skip to content

Commit

Permalink
[nspcc-dev#1028] writecache: Evict flushed big objects
Browse files Browse the repository at this point in the history
Make `flushBigObjects` routine to call `evictObjects` which was
successfully written to `BlobStor`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
  • Loading branch information
Leonard Lyubich authored and aprasolova committed Mar 5, 2022
1 parent 3c2b2af commit f6c5c7a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/local_object_storage/writecache/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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:
}
}
Expand Down

0 comments on commit f6c5c7a

Please sign in to comment.