Skip to content

Commit

Permalink
fix: flush base buffer at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
will@2012 committed May 23, 2024
1 parent ee34128 commit 8d30bcc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion trie/triedb/pathdb/nodebufferlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,18 @@ func newNodeBufferList(
waitForceKeepCh: make(chan struct{}),
keepFunc: keepFunc,
}

if nf.base.size > nf.base.limit {
// buffer base is loaded from disk layer journal which maybe bigger than limit,
// flush base at startup if it is bigger than limit.
nf.backgroundFlush()
}

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

0 comments on commit 8d30bcc

Please sign in to comment.