-
-
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
Multi file add does not work as I would expect #2811
Comments
hrm... interesting. That does seem like a bug |
I guess the 'proper' solution here would be to make each parameter to add be its own separate 'add' call |
So if the node is online, the client should make one request per file? Or are you thinking of something else. Note that when "-r" is specified and the node is online, |
@whyrusleeping an easier solution would be to disallow multiple files when I am hacking on this code now and think I can implement the above solution in a few hours. |
If neither "-w" or "-r" is specified don't use an mfs-root. Add and pin each file separately. Towards ipfs#2811 License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
@whyrusleeping I implemented a solution on my filestore branch (see 293e848). If neither '-w' or '-r' is specified it does not use an mfs-root and adds and pins each file individually. Pins are not flushed until the end to avoid a major slowdown. |
@kevina i think the solution is simpler than that. I believe all we need to do is change the |
@whyrusleeping I can try that, but for performance reasons it is important that pins are not flushed until the very end. Otherwise we lose most of the benefit of combining multiple files in a single command. In my informal tests the performance difference between flushing the pins each time and waiting to the end is an order of magnitude. There may also may be some performance lost due to the adding of an completely unnecessary directory object for each file. |
Towards ipfs#2811. License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
@whyrusleeping I implemented your solution in commit e4b48dd. I might be able to refactor the addAllAndPin to make this a little nicer. I modified PinRoot so that flushing can be delayed to the end. Otherwise, performance will suffer. I like my original solution better as it avoids the unnecessary mfs code altogether when directories are not being added. With your solution a unnecessary directory entry is being created and then left in the datastore. My very informal test thought, indicate that the performance is about the same in either solution. |
If neither "-w" or "-r" is specified don't use an mfs-root. Add and pin each file separately. Closes ipfs#2811 License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
@whyrusleeping #3258 implemented the solution I am currently using. I would prefer we just use that for now. The adder is likely to undergo a rewrite soon for #3172. |
If neither "-w" or "-r" is specified don't use an mfs-root. Add and pin each file separately. Closes #2811 License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
If neither "-w" or "-r" is specified don't use an mfs-root. Add and pin each file separately. Closes #2811 License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
If neither "-w" or "-r" is specified don't use an mfs-root. Add and pin each file separately. Closes #2811 License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
If neither "-w" or "-r" is specified don't use an mfs-root. Add and pin each file separately. Closes #2811 License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
It seams that even if
-w
is not specified, files added viaipfs add <file1> <file2> ...
are added to a mfs directory. As I see it this leads to two unexpected behaviors:Without
-w
the behavior I would expect is that each file is added and pinned individually.The text was updated successfully, but these errors were encountered: