Skip to content
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

Archive size wrong #5690

Open
Stebalien opened this issue Oct 29, 2018 · 5 comments
Open

Archive size wrong #5690

Stebalien opened this issue Oct 29, 2018 · 5 comments
Labels
exp/wizard Extensive knowledge (implications, ramifications) required kind/bug A bug in existing code (including security flaws)

Comments

@Stebalien
Copy link
Member

Stebalien commented Oct 29, 2018

When running ipfs get --archive, the expected size in the progress bar is wrong:

> ipfs get --archive /ipfs/QmPwecoMB9jN9DosznNqcApK63PnrEmMduxp1mn5nqS7Pq
Saving archive to QmPwecoMB9jN9DosznNqcApK63PnrEmMduxp1mn5nqS7Pq.tar
 68.00 KiB / 49.63 KiB [=====================================] 137.02% 0s

That is, the output file is actually 68KiB, 49.63 is the total size one would get when running ipfs get without --archive.

@Stebalien Stebalien added the kind/bug A bug in existing code (including security flaws) label Oct 29, 2018
@Stebalien
Copy link
Member Author

Stebalien commented Oct 29, 2018

Actually, it looks like the size computation is just wrong every which way, we're using the size of the DAG. Worse, we're using it to set the content length.

@overbool
Copy link
Contributor

overbool commented Oct 29, 2018

@Stebalien ipfs get Qm... without --archive prints the protobuf node size. we should unmarshal the data and then computate its size.

@Stebalien
Copy link
Member Author

Stebalien commented Oct 29, 2018

Really, I have no idea how to fix it. We need to compute the size on the server before we start transferring which we often can't do because we don't actually know it ahead of time. We have the size of the DAG but not the size of the TAR we're actually transferring (also, the DAG's size may be wrong).

I'm not sure if we can fix this properly with the current protocol.

@Stebalien Stebalien added the exp/wizard Extensive knowledge (implications, ramifications) required label Oct 30, 2018
@qiwaa
Copy link
Contributor

qiwaa commented Oct 31, 2018

Maybe we can store the TAR in ipfs. Then we know the size of it. Does that make sense?

@Stebalien
Copy link
Member Author

Stebalien commented Oct 31, 2018

That's not going to work for large datasets, unfortunately. We can't afford to materialize the entire tar file before shipping it off to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/wizard Extensive knowledge (implications, ramifications) required kind/bug A bug in existing code (including security flaws)
Projects
No open projects
Development

No branches or pull requests

3 participants