Skip to content

Commit

Permalink
freezer: compatible with pruneancient when restart;
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbundler committed Dec 28, 2023
1 parent 2f5d61b commit a5bb43c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/rawdb/freezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ func NewFreezer(datadir string, namespace string, readonly bool, offset uint64,

// Create the tables.
for name, disableSnappy := range tables {
// try to recreate idx files when enable prune ancient before
if offset > 0 && readonly {
table, err := newTable(datadir, name, readMeter, writeMeter, sizeGauge, maxTableSize, disableSnappy, false)
if err == nil {
table.Close()
}
}
table, err := newTable(datadir, name, readMeter, writeMeter, sizeGauge, maxTableSize, disableSnappy, readonly)
if err != nil {
for _, table := range freezer.tables {
Expand Down

0 comments on commit a5bb43c

Please sign in to comment.