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

fix: ensure that a new offset file ends with the zero data file length #8770

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Jun 12, 2024

The last offset is always the expected data file length. However, on creation this value wasn't being written. This is not an issue for a read-write environment since it will always recover, and that's why it wasn't caught until #8667 made it through.

Without it, NippyJarError::InconsistentState will be thrown on a read-only environment if the segment is empty. For example, reth db stats on a newly created datadir, will throw this error on Transaction segment

Also, makes sure we only write if the file is just created, and not always as it was before.

@joshieDo joshieDo added C-bug An unexpected or incorrect behavior A-static-files Related to static files labels Jun 12, 2024
@joshieDo joshieDo requested a review from shekhirin as a code owner June 12, 2024 09:48
@joshieDo joshieDo added this pull request to the merge queue Jun 12, 2024
Merged via the queue into main with commit 0a49d47 Jun 12, 2024
30 checks passed
@joshieDo joshieDo deleted the joshie/offset-creation branch June 12, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-static-files Related to static files C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants