Skip to content

Commit

Permalink
fix: adjust flush condition to avoid not flush
Browse files Browse the repository at this point in the history
  • Loading branch information
will@2012 committed May 23, 2024
1 parent ee34128 commit 9709228
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions trie/triedb/pathdb/nodebufferlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9709228

Please sign in to comment.