-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chain ranged export: rework and address current shortcomings
This commit moderately refactors the ranged export code. It addresses several problems: * Code does not finish cleanly and things hang on ctrl-c * Same block is read multiple times in a row (artificially increasing cached blockstore metrics to 50%) * It is unclear whether there are additional races (a single worker quits when reaching height 0) The changes: * Use a FIFO instead of stack: this is likely going to be more memory friendly as the slice capacity will evolve as needed as we remove elements from the head (previous stack would allocate a very large amount of memory) * We avoid a probably not small amount of allocations by not using unnecessary pointers * Flow is a bit simplified so that context cancellation correctly shuts-down workers and drains channels. * We ensure all work is finished before terminating the work, something that might have been broken in some edge cases previous. Initial testing shows the code is currently about 5% faster.
- Loading branch information
Showing
8 changed files
with
374 additions
and
274 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.