Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: do not lose files when writing files into subshards that contain other subshards #3936

Merged
merged 4 commits into from
Nov 12, 2021

Conversation

achingbrain
Copy link
Member

When writing a file into a hamt shard we hash the filename to figure out where in the
shard to place the file.

If the hash means that we end up adding the file into an existing subshard that also
contains another subshard, we should populate the other subshard's children otherwise
they will not be there when we calculate the new CID for the subshard and they will
be lost.

Fixes #3921

… other subshards

When writing a file into a hamt shard we hash the filename to figure out where in the
shard to place the file.

If the hash means that we end up adding the file into an existing subshard that also
contains another subshard, we should populate the other subshard's children otherwise
they will not be there when we calculate the new CID for the subshard and they will
be lost.

Fixes #3921
@achingbrain achingbrain merged commit 8a3ed19 into master Nov 12, 2021
@achingbrain achingbrain deleted the fix/writing-new-files-into-subshards branch November 12, 2021 11:25
lidel pushed a commit to ipfs/interop that referenced this pull request Nov 23, 2021
Switch to version that includes
ipfs/js-ipfs#3936
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ipfs files write corruption in large HAMTs
1 participant