Skip to content

Commit

Permalink
fix: support reset in readonly;
Browse files Browse the repository at this point in the history
  • Loading branch information
galaio committed Jan 8, 2025
1 parent 949a1e3 commit 5247776
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/rawdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, ancient string, namespace st

// if there has legacy offset, try to clean & reset the freezer metadata
if legacyOffset := ReadLegacyOffset(db); legacyOffset > 0 {
log.Info("Found legacy offset in freezerDB, will reset freezer meta", "offset", legacyOffset)
if err := resetFreezerMeta(chainFreezerDir, namespace, legacyOffset); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion core/rawdb/freezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func NewFreezer(datadir string, namespace string, readonly bool, maxTableSize ui
// Create the write batch.
freezer.writeBatch = newFreezerBatch(freezer)

log.Info("Opened ancient database", "database", datadir, "readonly", readonly, "frozen", freezer.frozen.Load())
log.Info("Opened ancient database", "database", datadir, "readonly", readonly, "tail", freezer.tail.Load(), "frozen", freezer.frozen.Load())
return freezer, nil
}

Expand Down

0 comments on commit 5247776

Please sign in to comment.