feat: CID importer multithreading #67
Closed
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.
Description
Two main features have been added to the CID importer cron:
Backups of entire CID files retrieved from Web3.storage to the Open Panda backblaze bucket
Multithreaded processing:
cid-batch-import.jsin the crons directory). The first part of the maincid-importer.jsscript is still the same; a manifest list of CIDs to download is still generated and stored totmp/cid-files/cid-manifest.txt. However, where retrieving the files from the manifest list was previously handled in batches processed in series, now the script delegates batches out to worker threads to process in parallel. Two new arguments can be passed to thecid-importer.jsscript:--threadsfollowed by the integer number of workers to add and a boolean argument--all, which, if true, skips the search for the last imported document in the database and retrieves all CIDs starting from the oldest existing upload. The previous two arguments, both which still apply, are;--pagesize- an integer specifying import/backup batch size and--maxpages- an integer to specify how many batches to process; if left unspecified, no limit will be placed on the number of batches.Ticket link
https://www.notion.so/agencyundone/Backup-all-dataset-manifests-to-Backblaze-3196a93f141546a3a91602d78b3dbd7f?pvs=4