-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: optimize memory for stacks tsv import into rocksdb (#634)
This PR changes the way chainhook imports a Stacks node TSV into rocksdb. Before, it loaded the entire canonical chinstate (including the full block JSON messages) onto a `VecDeque` in memory and then drained that data into rocksdb. This was a very memory intensive process which crashed our dev pods ever time it ran. Now, the process was changed to a `VecDeque` that only keeps the line numbers of the TSV where the block data exists, so it can later read blocks from the file 1 by 1 and insert them into rocksdb.
- Loading branch information
Showing
2 changed files
with
79 additions
and
24 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
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