Skip to content

Commit

Permalink
fix: add log for nbl
Browse files Browse the repository at this point in the history
  • Loading branch information
VM committed Jan 7, 2025
1 parent a887356 commit 7497d2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions triedb/pathdb/nodebufferlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ func (nf *nodebufferlist) recoverNodeBufferList(freezer *rawdb.ResettableFreezer
nf.size += current.size
nf.layers += current.layers
}
log.Info("Measure data", "nf.size", nf.size, "nf.layers", nf.layers, "nf.count", nf.count,
"rsevMdNum", nf.rsevMdNum)

nf.diffToBase()
log.Info("After diffToBase", "base_size", nf.base.size, "base_layers", nf.base.layers,
"nbl_layers", nf.layers)
nf.backgroundFlush()

log.Info("Succeed to recover node buffer list", "base_size", nf.base.size, "tail_state_id", nf.tail.id,
Expand Down Expand Up @@ -678,6 +683,9 @@ func (nf *nodebufferlist) traverseReverse(cb func(*multiDifflayer) bool) {
// periodically in the background
func (nf *nodebufferlist) diffToBase() {
commitFunc := func(buffer *multiDifflayer) bool {
log.Info("diffToBase function", "nf.base.size", nf.base.size, "nf.count", nf.count,
"buffer.block%nf.dlInMd", buffer.block%nf.dlInMd, "nf.base.limit", nf.base.limit, "nf.rsevMdNum", nf.rsevMdNum)

if nf.base.size >= nf.base.limit {
log.Debug("base node buffer need write disk immediately")
return false
Expand Down

0 comments on commit 7497d2d

Please sign in to comment.