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: SegmentHeader block range is now an Option<_> #6738

Merged
merged 10 commits into from
Feb 22, 2024

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Feb 22, 2024

When a SnapshotProviderRW creates a new file, it commits the configuration before it can be used. And block_range was being initialized as block.start..=block.start.

However, there is the case that if the node is interrupted before the first commit of a new file, then on restart, the node would return the wrong highest block of the segment. It would return block.start, when in fact it's just an empty file.

This would have consequences when calling get_snapshot_target, where it would assume that we need block.start + 1 -> tip data.

Changing SegmentHeader block_range to an option should fix this.

This will cause existing nodes on feat/static-files to be incompatible with this change, since the configuration file format changed
To make this less painful, I'll create a small cli tool that can generate configuration files (conf) with the same ranges, and so they can replace the existing ones.

--

  • Additional fix where we make a consistency heal but weren't committing with fsync to disk

@joshieDo joshieDo added C-bug An unexpected or incorrect behavior A-static-files Related to static files labels Feb 22, 2024
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
@onbjerg
Copy link
Member

onbjerg commented Feb 22, 2024

you mentioned that we can apply this fix w/o resyncing, can you document the procedure for that in the PR?

Copy link
Collaborator

@shekhirin shekhirin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one metrics nit

@joshieDo joshieDo merged commit 1431568 into feat/static-files Feb 22, 2024
23 of 25 checks passed
@joshieDo joshieDo deleted the joshie/option-block-range branch February 22, 2024 18:04
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.

4 participants