mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
triedb/pathdb: polish
This commit is contained in:
parent
eb6c814332
commit
298e2819da
1 changed files with 3 additions and 3 deletions
|
|
@ -34,11 +34,11 @@ const (
|
||||||
// index pruning too frequently.
|
// index pruning too frequently.
|
||||||
indexPruningThreshold = 90000
|
indexPruningThreshold = 90000
|
||||||
|
|
||||||
// indexPruneReopenInterval is how long the iterator is kept open before
|
// iteratorReopenInterval is how long the iterator is kept open before
|
||||||
// being released and re-opened. Long-lived iterators hold a read snapshot
|
// being released and re-opened. Long-lived iterators hold a read snapshot
|
||||||
// that blocks LSM compaction; periodically re-opening avoids stalling the
|
// that blocks LSM compaction; periodically re-opening avoids stalling the
|
||||||
// compactor during a large scan.
|
// compactor during a large scan.
|
||||||
indexPruneReopenInterval = 3 * time.Minute
|
iteratorReopenInterval = 3 * time.Minute
|
||||||
)
|
)
|
||||||
|
|
||||||
// indexPruner is responsible for pruning stale index data from the tail side
|
// indexPruner is responsible for pruning stale index data from the tail side
|
||||||
|
|
@ -214,7 +214,7 @@ func (p *indexPruner) prunePrefix(prefix []byte, elemType elementType, tail uint
|
||||||
}
|
}
|
||||||
// Periodically release the iterator so the LSM compactor
|
// Periodically release the iterator so the LSM compactor
|
||||||
// is not blocked by the read snapshot we hold.
|
// is not blocked by the read snapshot we hold.
|
||||||
if time.Since(opened) >= indexPruneReopenInterval {
|
if time.Since(opened) >= iteratorReopenInterval {
|
||||||
reopen = true
|
reopen = true
|
||||||
start = common.CopyBytes(key[len(prefix):])
|
start = common.CopyBytes(key[len(prefix):])
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue