Skip to content

Commit d39ffe6

Browse files
authored
filtermaps support history pruning cutoff point
1 parent 0712715 commit d39ffe6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/filtermaps/map_renderer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ func (f *FilterMaps) lastCanonicalSnapshotOfMap(mapIndex uint32) *renderedMap {
161161
// and starting log value pointer of the last block is also returned.
162162
func (f *FilterMaps) lastCanonicalMapBoundaryBefore(renderBefore uint32) (nextMap uint32, startBlock, startLvPtr uint64, err error) {
163163
if !f.indexedRange.initialized {
164-
return 0, 0, 0, nil
164+
return 0, f.historyCutoff, 0, nil
165165
}
166166
mapIndex := renderBefore
167167
for {
168168
var ok bool
169169
if mapIndex, ok = f.lastMapBoundaryBefore(mapIndex); !ok {
170-
return 0, 0, 0, nil
170+
return 0, f.historyCutoff, 0, nil
171171
}
172172
lastBlock, lastBlockId, err := f.getLastBlockOfMap(mapIndex)
173173
if err != nil {
@@ -229,7 +229,7 @@ func (f *FilterMaps) loadHeadSnapshot() error {
229229
if err != nil {
230230
return fmt.Errorf("failed to retrieve last block of head snapshot map %d: %v", f.indexedRange.maps.Last(), err)
231231
}
232-
var firstBlock uint64
232+
var firstBlock uint64 = f.historyCutoff
233233
if f.indexedRange.maps.AfterLast() > 1 {
234234
prevLastBlock, _, err := f.getLastBlockOfMap(f.indexedRange.maps.Last() - 1)
235235
if err != nil {

0 commit comments

Comments
 (0)