Skip to content

repair: fix forest to handle forks from non-frontier slots #4873

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

emwang-jump
Copy link
Contributor

No description provided.

@emwang-jump emwang-jump force-pushed the emwang/forest-fork-fix branch from 12835a9 to b02d033 Compare April 24, 2025 22:19
@emwang-jump emwang-jump marked this pull request as ready for review April 24, 2025 22:20
if( FD_UNLIKELY( !ele ) ) {
// traverse up the tree to see if we can find a parent
ele = fd_forest_ancestry_ele_query( ancestry, &slot, NULL, pool );
ulong parent_idx = ele->parent;
Copy link
Member

Choose a reason for hiding this comment

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

ancestor

Comment on lines +307 to +309
/* We hit this case when we are not on frontier, parent is not on
frontier, but grandparent is on frontier. Which means this data
shred will not be advancing the frontier. */
Copy link
Member

Choose a reason for hiding this comment

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

ancestor

@@ -284,6 +284,33 @@ advance_frontier( fd_forest_t * forest, ulong slot, ushort parent_off ) {
ulong parent_slot = slot - parent_off;
ele = fd_ptr_if( !ele, fd_forest_frontier_ele_query( fd_forest_frontier( forest ), &parent_slot, NULL, pool ), ele );

/* There's an edge case where a fork begins from from somewhere behind
Copy link
Member

Choose a reason for hiding this comment

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

hm... should this logic live in the insert helper function in forest instead?

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