-
-
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
CAR import should not pin roots by default (ipfs dag import --pin-roots=false) #9765
Comments
👌 reporting lack of pinning to the user might be appropriate too since it'll be a downgrade in behavior for some. But otherwise I think this is a really good change and puts more control in the users' hands (well it should, maybe we'll see if users expect to not have to think about this stuff). |
@lidel : I put this in 0.22 best effort track. Let me know if you disagree. |
I'm not particularly attached to the outcome here, but are we happy with the advantage of not pinning roots by default vs running in "offline" mode by default (as it is today)? Lines 190 to 193 in 18db593
We could write tests to defend against this if we're concerned (they might even be there already). AFAICT then the UX tradeoff for a CAR with a root for a DAG that is bigger than what's in the CAR is would you rather:
Option 1 sounds nicer to me since the user is more protected from accidentally bad decisions (particularly in light of defaults changing). However, that's just one person's opinion 😄. |
I've been digging a bit more and it seems we actually force offline pinning during
This means the problem of overfetching during What remains are UX problems around
PR switching default to |
* 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>
@Jorropo raised valid concerns around changing the default silently in #9926, which may lead to data loss (if someone assumed After my fixes the UX from #9926 (review) is good enough (correct exit code and human-readable error if recursive pinning failed), so we could flip the default back to So my ask would be to not revert that PR blindly (it adds important regression tests), but
|
This is a partial revert of b685355. Closes #9765 with compromise agreed 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>
This is a partial revert of b685355. Closes #9765 with compromise agreed 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>
This is a partial revert of b685355. Closes #9765 with compromise agreed in #9765 (comment)
Problem
We are working on Graph API for HTTP Gateways to enable
?format=car
that returns a subset of a DAG and/or parent nodes of a sub-path.As part of this work, we have to decide, if returned CAR stream includes root CIDs in CAR header, and anticipate what happens, when Kubo user tries to import such "bag of blocks" into local Kubo node using `ipfs dag import.
Ref. ipfs-inactive/bifrost-gateway#61 (comment) for more details.
Current state
The current default behavior of Kubo's
ipfs dag import
defaults to--pin-roots=true
, which will RECURSIVELY pin every CID from the CAR header.If any DAG blocks are not in the CAR, it will either fail due to pinning being in offline mode (this was the behavior last time I checked) OR if someone refactors it at some point, a network fetch may be triggered, overfetching often absurd amount of data (export single wiki article, overfetch 350GiB).
This is an unfortunate legacy behavior, but we can't ignore it. Kubo is used by the majority of IPFS ecosystem outside PL, and the majority of "partial/path CARs" fetched from Rhea/Saturn will be consumed by Kubo's
dag import
at some point.Also, pinning by default is inconsistent with
ipfs dag put
(which does not pin by default).Proposed change
Change
dag import
default to not pin (--pin-roots=false
)This will make
dag import
compatible with the vision of "CAR being just a bag of blocks",and make graph operations such as pinning DAG root recursively an opt-in.
cc @rvagg @ribasushi @aschmahmann – does this sound sensible?
The text was updated successfully, but these errors were encountered: