-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 ls
tries to get the contents inside the folder
#4229
Comments
On 2: It might be possible to store type metadata as multicodec in CID, as is currently done for raw-leaves files. |
We really shouldn't, that's not what CIDs are for. CIDs are used to determine how to decode some binary blob into an IPLD object. Ideally, one would only perform this CID introspection as an optimization (e.g., raw nodes can't have links). Unfortunately, this isn't currently the case but I'd rather not make it worse. A better way would probably be to inline this metadata into directories themselves. |
Hey @wpfnihao Thanks again for the detailed graphs! The fuse interface will always load the entire directory, this is unfortunately needed to address one of the previous bugs you reported where we were setting the type on every dirent to "File". As @Stebalien says, we should probably store this info in the directory itself. On that note, we should probably start designing ipld-unixfs. We have a lot of issues with the current unixfs that would be great to fix (including metadata, permissions, and executable bits). If someone wants to start thinking about this and drafting a proposal, that would be really helpful. |
@whyrusleeping I could probably work on that if no one else wants to pick it up. I would really like to see some sort of timestamp stored for directory entries also. |
@kevina lets start gathering requirements in an issue in this new repo: https://github.com/ipfs/ipld-unixfs This is something we need to think about very carefully, as we only really get one shot at changing it. |
Version information:
go-ipfs version: 0.4.10-
Repo version: 5
System version: amd64/linux
Golang version: go1.8.3
Type:
Medium
Severity:
Low
Description:
Environment:
One folder containing 100,000 files, each of the size 100KB.
Two servers with 1Gb network.
The test folder added in one server and requested by the other one.
I have tested the performance of
ipfs ls
. It seems thatipfs ls
with the option--resolve-type=true
, which is the default setting, ipfs will get the contents inside the folder for just listing the folder information (see Fig. 3 and Fig. 4).I have a quick look of the go-ipfs codes at
go-ipfs/core/commands/ls.go
, which confirms my guess:After that, I also tested
ipfs ls --resolve-type=false
andFUSE + native ls
(see Fig. 1-2 and Fig. 5-6). The results show that with--resolve-type=false
ipfs will only get the folder info block, andFUSE + native ls
has the similar behavior withipfs ls --resolve-type=true
.I know that ipfs needs the linked blocks to resolve the data type (in
go-ipfs/unixfs/pb/unixfs.pb.go
):My problems here:
Thank you.
Related to #3120
Fig. 1:

ipfs ls --resolve-type=false
SenderFig. 2:

ipfs ls --resolve-type=false
ReceiverFig. 3:

ipfs ls --resolve-type=true
SenderFig. 4:

ipfs ls --resolve-type=true
ReceiverFig. 5:

ls
with FUSE SenderFig. 6:

ls
with FUSE ReceiverThe text was updated successfully, but these errors were encountered: