From fc42844fbf65b79474aa5e6843bcba33d17be401 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 9 Dec 2021 15:30:45 +0300 Subject: [PATCH] [#1028] writecache: Evict flushed big objects Make `flushBigObjects` routine to call `evictObjects` which was successfully written to `BlobStor`. Signed-off-by: Leonard Lyubich --- pkg/local_object_storage/writecache/flush.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/local_object_storage/writecache/flush.go b/pkg/local_object_storage/writecache/flush.go index 3d15de1a5..b2faf7a18 100644 --- a/pkg/local_object_storage/writecache/flush.go +++ b/pkg/local_object_storage/writecache/flush.go @@ -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: } }