Skip to content

Commit

Permalink
Fixed panic of .idx during merge of historical .idxes (#12133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 authored Sep 29, 2024
1 parent ad05810 commit 4b9199b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion eth/stagedsync/stage_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ import (
"github.com/erigontech/erigon/turbo/snapshotsync/freezeblocks"
)

const pruneMarkerSafeThreshold = 1000 // Keep 1000 blocks of markers in the DB below snapshot available blocks
const (
/*
we strive to read indexes from snapshots instead to db... this means that there can be sometimes (e.g when we merged past indexes),
a situation when we need to read indexes and we choose to read them from either a corrupt index or an incomplete index.
so we need to extend the threshold to > max_merge_segment_size.
*/
pruneMarkerSafeThreshold = snaptype.Erigon2MergeLimit * 1.5 // 1.5x the merge limit
)

type SnapshotsCfg struct {
db kv.RwDB
Expand Down

0 comments on commit 4b9199b

Please sign in to comment.