Skip to content

Commit

Permalink
fix: adjust flush condition to avoid not flush (#114)
Browse files Browse the repository at this point in the history
Co-authored-by: will@2012 <[email protected]>
  • Loading branch information
will-2012 and will@2012 authored May 24, 2024
1 parent ee34128 commit f9643c4
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 f9643c4

Please sign in to comment.