Skip to content

Comments

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

Merged
joshieDo merged 1 commit intomainfrom
joshie/offset-creation
Jun 12, 2024
Merged

fix: ensure that a new offset file ends with the zero data file length#8770
joshieDo merged 1 commit intomainfrom
joshie/offset-creation

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
@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