[#1088] writecache: Fix small flushed when persist

Signed-off-by: ZhangTao1596 <zhangtao@ngd.neo.org>
remotes/fyrchik/cli-wallet-flag
ZhangTao1596 2022-01-19 17:51:58 +08:00 committed by fyrchik
parent 7c02a2e251
commit ac82899e85
1 changed files with 3 additions and 1 deletions

View File

@ -79,12 +79,14 @@ func (c *cache) persistSmallObjects(objs []objectInfo) {
if err != nil {
overflowIndex = 0
} else {
c.evictObjects(overflowIndex)
c.evictObjects(len(objs) - overflowIndex)
}
for i := 0; i < overflowIndex; i++ {
storagelog.Write(c.log, storagelog.AddressField(objs[i].addr), storagelog.OpField("db PUT"))
c.objCounters.IncDB()
}
for i := overflowIndex; i < len(objs); i++ {
c.flushed.Add(objs[i].addr, true)
}