fix(provider): migrate-v2 crash on pruned nodes with no prior changeset static files#23698
Closed
PatrickTulskie wants to merge 1 commit into
Closed
fix(provider): migrate-v2 crash on pruned nodes with no prior changeset static files#23698PatrickTulskie wants to merge 1 commit into
PatrickTulskie wants to merge 1 commit into
Conversation
…s exist Closes paradigmxyz#23691 When migrate-v2 runs on a pruned full node, AccountChangeSets has no prior static files. update_index was computing segment_max_block = expected_block_start - 1, pointing to a range that never existed, and then crashing trying to NippyJar::load it. Guard the heuristic behind a check that the segment already has files in the index.
Member
|
Superseded by #23716, found a couple more issues and will be merging it soon, thanks! |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #23691
When migrate-v2 runs on a pruned full node,
AccountChangeSetshas no prior static files. The writer starts at a non-zero block (the block after the prune checkpoint), which lands at the start of a new static-file range.update_indexwas computing segment_max_block = expected_block_start - 1 to point at the "previous file" — but that file never existed on a v1 node, soNippyJar::loadhit ENOENT and the migration crashed.The fix is to just guard the heuristic behind a check that the segment already has static files in the index. When it doesn't,
segment_max_blockis None and no load is attempted.I will add that while this should fix the crash, tests all pass and things look good, I'm not familiar enough with the v2 database format to know if this causes other problems or side effects. Figured it was worth a shot though.