Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/rawdb: skip setting flushOffset in read-only mode #31173

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

rjl493456442
Copy link
Member

This PR addresses a flaw in the freezer table upgrade path.

In v1.15.0, freezer table v2 was introduced, including an additional
field (flushOffset) maintained in the metadata file. To ensure
backward compatibility, an upgrade path was implemented for legacy
freezer tables by setting flushOffset to the size of the index file.

However, if the freezer table is opened in read-only mode, this file
write operation is rejected, causing Geth to shut down entirely.

Given that invalid items in the freezer index file can be detected and
truncated, all items in freezer v0 index files are guaranteed to be complete.
Therefore, when operating in read-only mode, it is safe to use the
freezer data without performing an upgrade.

@rjl493456442 rjl493456442 added this to the 1.15.1 milestone Feb 13, 2025
@fjl
Copy link
Contributor

fjl commented Feb 13, 2025

I'm approving this for v1.15.1 as a simple fix, but unsure why we even enter the repair in read-only mode. Maybe it should be detected earlier.

@fjl fjl merged commit 913fee4 into ethereum:master Feb 13, 2025
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants