-
Notifications
You must be signed in to change notification settings - Fork 296
repair: fix forest and fec chainer publish edge cases #5519
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
Conversation
1dcb5d6
to
893a2b5
Compare
893a2b5
to
ee70fdb
Compare
} | ||
child = fd_forest_pool_ele( pool, child->sibling ); | ||
} | ||
ulong remove = fd_forest_orphaned_idx_remove( orphaned, &head->slot, null, pool ); /* remove myself */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clear remove->next
too in case there was a map collision (can lead to subtle bugs)
ulong remove = fd_forest_orphaned_idx_remove( orphaned, &head->slot, null, pool ); /* remove myself */ | |
fd_forest_ele_t * remove = fd_forest_orphaned_ele_remove( orphaned, &head->slot, null, pool ); | |
remove->next = idx_null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to deque for bfs
fd_forest_ele_t * remove = fd_forest_ancestry_ele_remove( ancestry, &new_root_ele->slot, NULL, pool ); | ||
if( FD_UNLIKELY( !remove ) ) { | ||
/* Very rare case where during second incremental load we could publish to an orphaned slot */ | ||
remove = fd_forest_orphaned_ele_remove( orphaned, &new_root_ele->slot, NULL, pool ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clear remove->next
4cf636a
to
cc1cc9e
Compare
src/discof/forest/fd_forest.c
Outdated
@@ -42,6 +42,7 @@ fd_forest_new( void * shmem, ulong ele_max, ulong seed ) { | |||
void * ancestry = FD_SCRATCH_ALLOC_APPEND( l, fd_forest_ancestry_align(), fd_forest_ancestry_footprint( ele_max ) ); | |||
void * frontier = FD_SCRATCH_ALLOC_APPEND( l, fd_forest_frontier_align(), fd_forest_frontier_footprint( ele_max ) ); | |||
void * orphaned = FD_SCRATCH_ALLOC_APPEND( l, fd_forest_orphaned_align(), fd_forest_orphaned_footprint( ele_max ) ); | |||
void * deque = FD_SCRATCH_ALLOC_APPEND( l, fd_forest_deque_align(), fd_forest_deque_footprint( ele_max ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align footprint starting parens too
src/discof/forest/fd_forest.c
Outdated
@@ -51,6 +52,7 @@ fd_forest_new( void * shmem, ulong ele_max, ulong seed ) { | |||
forest->ancestry_gaddr = fd_wksp_gaddr_fast( wksp, fd_forest_ancestry_join( fd_forest_ancestry_new( ancestry, ele_max, seed ) ) ); | |||
forest->frontier_gaddr = fd_wksp_gaddr_fast( wksp, fd_forest_frontier_join( fd_forest_frontier_new( frontier, ele_max, seed ) ) ); | |||
forest->orphaned_gaddr = fd_wksp_gaddr_fast( wksp, fd_forest_orphaned_join( fd_forest_orphaned_new( orphaned, ele_max, seed ) ) ); | |||
forest->deque_gaddr = fd_wksp_gaddr_fast( wksp, fd_forest_deque_join ( fd_forest_deque_new ( deque, ele_max ) ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align
55600ed
to
f79f332
Compare
f79f332
to
5240701
Compare
ele = fd_ptr_if( !ele, fd_forest_frontier_ele_query( fd_forest_frontier( forest ), &slot, NULL, pool ), ele ); | ||
return ele; | ||
FD_FN_PURE static inline ulong * | ||
fd_forest_deque( fd_forest_t * forest ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be in the .h
?
src/discof/forest/fd_forest.h
Outdated
FD_LAYOUT_INIT, | ||
alignof(fd_forest_t), sizeof(fd_forest_t) ), | ||
fd_fseq_align(), fd_fseq_footprint() ), | ||
fd_forest_pool_align(), fd_forest_pool_footprint( ele_max ) ), | ||
fd_forest_ancestry_align(), fd_forest_ancestry_footprint( ele_max ) ), | ||
fd_forest_frontier_align(), fd_forest_frontier_footprint( ele_max ) ), | ||
fd_forest_orphaned_align(), fd_forest_orphaned_footprint( ele_max ) ), | ||
fd_forest_deque_align(), fd_forest_deque_footprint( ele_max ) ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align
fixest publish edge cases specifically for second incremental loading