File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ def:
205205 globs :
206206 - " eth/downloader/downloader.go"
207207 - " eth/downloader/receiptreference.go"
208+ - title : PathDB diff-layers limit
209+ description : |
210+ Prevent the write-buffer to grow too large, to keep the journal optional,
211+ and not restart on top of unavailable state.
212+ globs :
213+ - " triedb/pathdb/buffer.go"
208214 - title : Discv5 node discovery
209215 description : Fix discv5 option to allow discv5 to be an active source for node-discovery.
210216 globs :
Original file line number Diff line number Diff line change @@ -114,7 +114,10 @@ func (b *buffer) empty() bool {
114114// full returns an indicator if the size of accumulated content exceeds the
115115// configured threshold.
116116func (b * buffer ) full () bool {
117- return b .size () > b .limit
117+ // Limit not just by data size, but also the number of layers:
118+ // if we allow the write-buffer to become larger,
119+ // the journal becomes critical to not roll back to an unavailable state.
120+ return b .size () > b .limit || b .layers >= uint64 (maxDiffLayers )
118121}
119122
120123// size returns the approximate memory size of the held content.
You can’t perform that action at this time.
0 commit comments