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

foofoo.block has more links than UnixFS Blocksizes #5312

Closed
schomatis opened this issue Jul 30, 2018 · 7 comments
Closed

foofoo.block has more links than UnixFS Blocksizes #5312

schomatis opened this issue Jul 30, 2018 · 7 comments
Labels
kind/test Testing work

Comments

@schomatis
Copy link
Contributor

schomatis commented Jul 30, 2018

I'm refactoring the DAG reader (#5257) and I'm having an error in the test file t0110-gateway.sh where the foofoo.block file, which is saved as a block and retrieved as a file DAG through the gateway, would appear to have an inconsistency between its number of DAG links and its number of UnixFS Blocksizes, is this expected in the test? If not, how could I regenerate that file with the UnixFS format fixed?

/cc @magik6k

@kevina
Copy link
Contributor

kevina commented Jul 30, 2018

This is not broken.

Please see #4680 (comment) and #4286 (comment).

@schomatis
Copy link
Contributor Author

Thanks for the references @kevina, I'll take a closer look at them. From a first read I'm understanding that UnixFS Blocksizes might be optional, I guess my question then is, to make the DAG reader comply with the standard expected behavior, if there is indeed a mismatch between those two indicators, what should be the correct response when seeking? I'll keep reading to see if I can find the answer there.

@kevina
Copy link
Contributor

kevina commented Jul 31, 2018

@schomatis yes please see #4680 as is is closely related.

@schomatis
Copy link
Contributor Author

So, reading the PR that added this test, #4320, I understand that this is testing how to handle a UnixFS file that has no Blocksizes, and the answer seems to be rely on the UnixFS Filesize, @magik6k, is this correct? I can rely on the UnixFS Filesize and I should not trust Blocksizes (using instead the DAG links)?

@schomatis
Copy link
Contributor Author

Fixed with a777290.

@magik6k
Copy link
Member

magik6k commented Aug 1, 2018

AFAIK We want to relay on Blocksizes if they are present and defer to Filesize only if we really need to. See #4680 (comment) for better explanation/interpretation.

@schomatis
Copy link
Contributor Author

Yes, my question was mostly oriented to how should the reader behave with the gateway to pass this particular test (the other seems to be a discussion for a long term solution), I understand now that -1, nil should be returned without moving the offset when there are no Blocksizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/test Testing work
Projects
None yet
Development

No branches or pull requests

3 participants