Storacha migration tool - #1264
Conversation
e2c30d3 to
c80c79a
Compare
Tracks filecoin-project/curio#1264 (commit 7c8297ca).
7c8297c to
2829cf6
Compare
|
Heads-up from running this branch in production: the "more parallel IPNI tasks" commit hardcodes |
cc405c3 to
91a77c6
Compare
|
@TippyFlitsUK Let me know when we are good to close this and delete the branch. |
|
@TippyFlitsUK is still tracking this thread with the migration still ongoing, he will close this issue ticket out once done. I put down a ECD of 202607 in the project tracker. |
575fc4e to
21038e3
Compare
21038e3 to
01d8259
Compare
Summary
import-pieces
Summary
Adds a one-off curio import-pieces tool for the Storacha migration.
The tool imports existing Storacha CAR files into Curio piece-park storage by:
The migration is retryable across the important crash points:
How To Use
Source directory must contain Storacha CAR files named:
<piece-cid-v2>.carTarget must be the directory of an attached Curio storage path, for example:
/path/to/curio-storageRun in batches:
The command writes JSON to --result:
{ "count": 20, "pieces": ["<piece-cid-v2>", "..."], "error": "optional error string on failed runs" }After each invocation, read --result even if the command exits non-zero. The file contains the pieces successfully imported by that invocation only. It is not cumulative and may be overwritten by the next run.
Re-run until the command exits successfully with count = 0. If a run returns an error, process any pieces present in --result first, then retry or stop based on the error.
aggregate-pieces
Summary
Adds a one-off
curio toolbox aggregate-piecestool for the Storacha migration.The tool aggregates already-imported Storacha pieces into larger Curio piece-park pieces by:
<target>/storacha-aggregate-work/<input-sha256>parked_piecesrowssource/piece/s-t00-<parked_piece_id>sortgroups.jsonlreplay plandatasegmentbefore committing the grouping plantask_aggregation<target>/storacha-aggregate-stagingimport-piecesThe aggregate migration is retryable across the important crash points:
groups.jsonlfilestoracha-aggregate-staging/staged/<piececidv2>existsAdds coverage for aggregate migration behavior, including raw bucket cursor recovery, dedupe, grouping, completed marker resume, temp-file overwrite, staged-file recovery, final-file recovery, missing staged-file cleanup, uncommitted staging cleanup, and final size mismatch cleanup.
How To Use
Input file must contain one already-imported Storacha PieceCIDv2 per line:
Source must be a Curio-style piece storage directory containing the source pieces:
<source>/piece/s-t00-<parked_piece_id>Target must be the directory of an attached Curio storage path, for example:
/path/to/curio-storageRun:
The command writes JSON to --result:
{ "aggregates": [ { "piece_cid": "<aggregate-piece-cid-v2>", "sub_pieces": ["<subpiece-cid-v2>", "..."], "count": 123 } ], "error": "optional error string on failed runs" }After each invocation, read --result even if the command exits non-zero. The file contains the aggregate pieces successfully completed from the work directory. It may be overwritten by the next run.
Re-run until the command exits successfully. If a run returns an error, process any aggregates present in --result first, then retry or stop based on the error.