From 97092286f20cdb837085d01ee9323795cbc1a654 Mon Sep 17 00:00:00 2001 From: "will@2012" Date: Thu, 23 May 2024 18:59:43 +0800 Subject: [PATCH] fix: adjust flush condition to avoid not flush --- trie/triedb/pathdb/nodebufferlist.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trie/triedb/pathdb/nodebufferlist.go b/trie/triedb/pathdb/nodebufferlist.go index f0954e826d..44958d6fda 100644 --- a/trie/triedb/pathdb/nodebufferlist.go +++ b/trie/triedb/pathdb/nodebufferlist.go @@ -128,11 +128,12 @@ func newNodeBufferList( waitForceKeepCh: make(chan struct{}), keepFunc: keepFunc, } + go nf.loop() log.Info("new node buffer list", "proposed block interval", nf.wpBlocks, "reserve multi difflayers", nf.rsevMdNum, "difflayers in multidifflayer", nf.dlInMd, - "limit", common.StorageSize(limit), "layers", layers, "persist id", nf.persistID) + "limit", common.StorageSize(limit), "layers", layers, "persist id", nf.persistID, "base_size", size) return nf } @@ -590,7 +591,7 @@ func (nf *nodebufferlist) loop() { continue } nf.diffToBase() - if nf.base.size > nf.base.limit { + if nf.base.size >= nf.base.limit { nf.backgroundFlush() } nf.isFlushing.Swap(false)