-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat!: dag import - don't pin roots by default #9926
Conversation
70be4fb
to
a9a5130
Compare
a9a5130
to
2c84005
Compare
I think this is just down to the existing sharness flakies now. |
I'm all up for this, but there are still tests failing which do not seem to be due to flakiness: https://tf-aws-gh-runner.s3.amazonaws.com/linux-x64-4xlarge/ipfs/kubo/5219378103/1/sharness.html#t0054-dag-car-import-export |
I'm missing why #9755 should be fixed in the first place. AFAIK The current usecase of With IPIP402 & friends we will now produce car files which are incomplete and or do not have roots. |
Yep, consider the workflow options with a CAR in hand - it has to go in to some other toolchain to be manipulated. We've made go-car happy with partial DAGs so you can pass it through Or perhaps you're doing some incremental DAG work and building up a larger DAG using Kubo as your blockstore, (I'm actually doing this right now with this exact workflow, building up Wikipedia by grabbing pieces of it and putting them into Kubo to help it along since it seems to have trouble walking the entire DAG for me). And besides, if the behaviour of Kubo |
2c84005
to
02e8372
Compare
02e8372
to
b30f46b
Compare
thanks for the details @hacdias, I didn't know those reports were available, I've been trying to search through the logs in Actions but I can see now there's links to those reports in the "Summary" page, that's quite nice! |
Good points. We have different user stories here that have strict behaviour incompatible with each other:
This pull request is a silent behaviour change someone could I don't think anyone relies on the fetch missing blocks behaviour, so we could remove that. So: $ curl https://saturn.ms/ipfs/cid/dir/file.jpg?format=car | ipfs dag import
Partial Data detected, blocks have been imported but not pinned. $ ssh ipfs@my.other.server "ipfs dag export QmcniBv7UQ4gGPQQW2BwbD4ZZHzN3o3tPuNLZCbBchd1zh" | ipfs dag import
Pinned root QmcniBv7UQ4gGPQQW2BwbD4ZZHzN3o3tPuNLZCbBchd1zh success |
yeah, that's not a terrible compromise .. way more than I wanted to bite off with this PR though! |
14eed26
to
b30f46b
Compare
Some notes:
Change
|
non-maintainer opinion - more API surface area is not better, just more things to test and maintain. I think if the main use-case that involves pinning is the cold-storage one then an explicit ask to I think I prefer @Jorropo's suggestion of only pinning if the root(s) references a complete DAG in the file. I just don't want to have to do that work tbqh! |
My 2 cents: as @rvagg mentioned, I don't think it's a good idea to add yet another command when this can easily be solved with the flag. In addition, I think @Jorropo's suggestion of pinning the roots by default iff the full DAG is available is a sensible solution. If no one's available to do that at the moment, I would accept the PR in the current state with the breaking change. |
this adds basic regression test that guards behavior around partial cars with or without pinning
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.
Ok, I've tested this with IPIP-402 + #9945 and confirmed dag import
command now correctly errors on partial cars:
$ curl -v 'http://127.0.0.1:8080/ipns/docs.ipfs.tech?format=car&dag-scope=entity' > ./partial-entity.car # Kubo 0.21.0-rc1 with IPIP-402 (only root block of unixfs dir)
$ ipfs dag import --stats --pin-roots=true ./partial-entity.car
Error pinning QmPDC11yLAbVw3dX5jMeEuSdk4BiVjSd9X87zaYRdVjzW3 FAILED: block was not found locally (offline): ipld: could not find QmPDvrDAz2aHeLjPVQ4uh1neyknUmDpf1GsBzAbpFhS8ro
Imported 1 blocks (1618 bytes)
[exit code 1]
Added some regression tests in 20b7e18 and bit longer changelog in e2ac0d4 – should be good enough for now.
Thank you for the push on this @rvagg!
Merging after CI passes (this is net-better than previous state imo – longer rationale in #9765 (comment))
* feat!: dag import - don't pin roots by default Fixes: #9765 * test(ipip-402): dag import this adds basic regression test that guards behavior around partial cars with or without pinning * docs(ipip-402): ipip and dag import changelog --------- Co-authored-by: Marcin Rataj <lidel@lidel.org>
* feat!: dag import - don't pin roots by default Fixes: #9765 * test(ipip-402): dag import this adds basic regression test that guards behavior around partial cars with or without pinning * docs(ipip-402): ipip and dag import changelog --------- Co-authored-by: Marcin Rataj <lidel@lidel.org>
Fixes: #9765
(I can never get the Kubo tests to run, even the short set, locally, so I'm having to do this in CI, it might result in a series of force pushes, sorry).