-
-
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
Add: recursion fix #158
Comments
SGTM |
I think this is a non-issue now that ipfs add writes differently. |
Eh, now that i think about it, this isnt entirely fixed since the directories will be recursively added after the files under them are. |
@whyrusleeping is this fixed now? |
I dont think so... right here: https://github.com/jbenet/go-ipfs/blob/master/core/commands/add.go#L129 we recursively add the given node, when all of its children should have already been added to the DAG during |
@whyrusleeping i think you're right. if this is not correct, will the tests we have catch it? if so, let's try it. |
Yeah, the tests will catch that one. lets give it a try |
gx publish 4.1.3
We switch to autosharding setup in ipfs#8527
We switch to autosharding setup in ipfs#8527
We switch to autosharding setup in ipfs#8527
We switch to autosharding setup in ipfs#8527
* chore: interop with go-ipfs 0.13 Applies necessary changes to ensure 'block/put' works and is backward-compatible. Context: #8568 * chore: 0.3.1 bumping as patch because we bumped to 0.3.0 recently, as part of other (unreleased) go-ipfs 0.13 work This commit was moved from ipfs/go-ipfs-http-client@ecf364c
Currently subblocks are not added with addNode directly, but as part of their file dags. Currently, dir-file recursion happens via calls to
addNode
, and subblock recursion happens whenaddNode
(on a file) callsDAG.AddRecursive(nd)
.The fact that
addNode
callsDAG.AddRecursive(nd)
means it will try to add nodes again and again asaddNode
is called with parent dirs. The two alternatives are to either do everything with recursive backtracking, or generate the whole dag first, and then callDAG.AddRecursively(root)
. The former approach is less memory intensive (as the whole DAG does not need to be in memory) and parallelizes better, as can work on siblings simultaneously (without relying on the parallelism being insideDAG.AddRecursively
).Two related changes needed:
addNode
on the subblock).addNode
should callDAG.Add(nd)
The text was updated successfully, but these errors were encountered: