-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
[pcloud] OpenWriterAt: Default values for multi threaded upload #8225
Comments
I think option 1 is probably the best, but how to do it neatly... There are some related problems with multi thread transfers. For example the S3 backend has --s3-upload-cutoff which is used to switch between single part and multi part, but under certain conditions the --multi-thread-cutoff flag is used instead. This is super confusing to users. The same situation happens with concurrency, and now here with chunk size. So maybe what we need is an info struct with these 3 things in. This could maybe be part of the Features() struct, not sure. We need to know whether these are set or not (to use the global defaults) so they need to default to an invalid value. Zero is probably ok. I think that would solve your problem and also some other ones which have been annoying the users! We would need to add a flag to the pcloud backend so it could be independently controlled. How does that sound? |
Hey @ncw,
What I outlined in PR #8226 is that the backend would only provide it's own default for the global option.
What do you think? |
That is a good way of thinking about it - how to explain to the user what is happening. There is some complication in the above though...
There are two ways we can do multi thread copies
Currently with OpenChunkWriter the backend specifies a chunk size and that gets used. Due to the way that protocol works, that is probably the only way it can be done. The cutoff and the streams are a bit of a mess though. Currently with OpenWriterAt the backend has no say at all and the values of the My concern in the above scheme is that it that the backend will always specify a value for chunk size, cutoff and concurrency most likely so I think we need something a bit more complicated
Detecting whether a value has been changed from the default isn't particularly easy with the rclone config system unfortunately - the config system provides either the value the user set or a default. To detect whether it is not the default will require a bit of extra work, expecially considering the defaults can be set with environment variables. Another alternative would be
That would be much easier to implement but doesn't let the user lower values easily. |
Agree, the max option would be easiest to implement but not being able to lower values can easily be a really bad thing for users. Also quite surprising, I've never seen a cli acting like that. My take was actually to remove the option from the backend (e.g.
Only catch is that we need to specify whether the option was set or not. As you already said, it's not exactly convenient but possible. We could make it code wise a bit nicer by abstracting a function for it though. On the other hand, we could also turn it around by removing the global option and solely relying on the backends to offer an option. Then it would also be easy implementation wise:
The configuration would then be the first of
You can hardly go simpler. |
Agreed
I don't think we can remove the backend options. They've been around for a long time and for most of that time were the only way of controlling multipart copies
I like this idea better. This would effectively make the --multi-thread-* options obsolete. We can't remove them though (backwards compatibility) but they could make a warning. I think it is better to be able to get the info struct separately from OpenWriterAt though because committing to calling it means it is too late to decide on the cutoff. I'll have a noodle with some code and see if it gives me any ideas! |
The associated forum post URL from
https://forum.rclone.org
Follow up on #8147
What is your current rclone version (output from
rclone version
)?Latest master
What problem are you are trying to solve?
As @ncw described it:
How do you think rclone should be changed to solve that?
As far as I see there are two approaches:
IMHO 1/ is more invasive to the code base but cleaner and consistent with the ChunkWriter. Your thoughts @ncw?
How to use GitHub
The text was updated successfully, but these errors were encountered: