-
-
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
ipfs files write -e -t --raw-leaves --cid-ver 1
ended up with a weird layout
#6936
Comments
Since I have the complete debug log of the shell script, I could recover the content which actually should end up in this node... (hope it's bytewise the same, but that's not absolutely certain).
And since the repo does not hold the data of the previous CID of this file (before the script wrote the data which failed to be properly written) it's pretty likely that the GC run either while or afterward of the write command. |
I am not sure I get it. The original command is missing a |
Yeah sorry, fixed that. That code is not that what's actually running, so I haven't copied it, but just wrote it down and made the error.
So I'm basiclly reading a file, adding stuff to the variable and writing it on the same filename again with This worked great for a while, then I decided to use cid-version 1 and obviously the GC was running at the same time the script issued this command and I ended up with a file with 6 zero blocks and a 7th block containing the actual file data. A read on the path or the CID returns no data and hangs indefinitely. |
@RubenKelevra I tried this out - I saved the HTML for this page and ran this: cat ~/Desktop/https_github.com_ipfs_go-ipfs_issues_6936.html | ipfs files write --create --truncate --raw-leaves --parents --cid-version 1 /path/to/file (Note I had to add This returned without error and I was able to Do you have a file we can use to reproduce this behaviour? Also you said you couldn't use IPFS to read the file that was created - what error message are you getting? GC should not have run during the operation, IPFS should be taking locks to ensure it doesn't run GC during MFS mutations. |
Sorry, the notification slipped by.
An
It was just a simple HTML-File like a apache-listing of a directory. I was adding a list item on each run. I switched to removing the file from the MFS and using I going to write a short example code and run it on my notebook until it happens and report back. |
So, this script would replicate the access pattern: A file gets read by it's CID, the content will be modified slightly at the end, and then the whole file gets rewritten. I use just the file's own CID as random data input. My guess is, that there's a race condition bug when a file gets truncated and rewritten but the initial blocks already exist on the datastore. But my file cannot reproduce this issue with the version from the
|
I was not able to reproduce "cat stall indefinitely" with the above script, so switching this to P2. I was able to replicate a version of this with go-ipfs 0.9.0-rc2 by executing below command 5 times:
It produced a weird DAG ( The file can be read via |
ipfs files write -e -t --raw-leaves --cid-ver 1
ended up with a weird layout and is unreadableipfs files write -e -t --raw-leaves --cid-ver 1
ended up with a weird layout
I'm sorry guys, I'm always hitting the weird ones :/
Version information:
go-ipfs version: 0.4.23-6ce9a355f
Repo version: 7
System version: amd64/linux
Golang version: go1.13.7
Description:
I rewrote a file with
in a shell-script. This created the following CID, which can neither be read by
nor by
I've inspected the layout of this cid in the webgui on a different node, and there are 6 empty blocks and a 7th block with some length, which isn't the layout I expected.
I don't set the --flush command, so it's on its the default. The garbage collector did run on this node today, but I cannot verify if this happened simultaneously or not. So there's a chance that the GC did cause trouble for
--truncate
.The .ipfs folder is stored on a ZFS, which shows no data integrity errors, I'm currently running a
ipfs repo verify
but I doubt it will find any issues either.The text was updated successfully, but these errors were encountered: