-
Notifications
You must be signed in to change notification settings - Fork 34
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
Restore improvement: transfers #4054
Conversation
0351623
to
7d8da34
Compare
@karol-kokoszka This PR is ready for review! I have one question - I added transfers as a singular It might be more idiomatic for it to be I could extend
What are your thoughts on this? |
I'm not sure if I understand. So now, the transfers from The goal is to change the number of transfer only in context of the given task (restore). |
Setting transfers works like setting rate limit. We can't just simply set transfers on the level of a single So if restore and backup are supposed to work on a different amount of transfers, each of them should set transfers on their own. So my solution was to set transfers before each backup and restore task, so I also added |
So the question asked here originates from the fact that changing transfers amount is a global change (in the context of a single node), and also because we wanted to make So if we start changing the transfers amount, they won't re-set themselves to the default values on their own, and perhaps user would like to have such granular control in some cases, e.g. mixed shard clusters. So that's why I proposed the additional special |
Of course, we could try to extend |
As per sync.
We must block the situation where the restore is running at the same time as backup -> a.k.a. #4045 . By default, a backup job should be mutually exclusive to the restore job. |
fc0d129
to
1506638
Compare
@karol-kokoszka I addressed changes from this comment. Could you again take a look? Also, here is the ground work PR. |
This commit allows for greater control over transfers and rate limit as a part of the upload/download rclone API used by backup/restore tasks. It also makes the changes more persistent in case of agent restarts. It also adds the core/transfers endpoint that can be used outside the upload/download rclone API in order to set the amount of transfers for the following rclone API calls.
This commit exposes the /rclone/core/transfers agent endpoint via agent client.
This commit requires changes in the usage of RcloneCopyPaths in restore pkg. It also adds Transfers field to restore Target with the default value -1 meaning that transfers will be set to the amount specified in agent rclone server config.
Our experiments showed that the fastest file download was achieved for transfers=2*2*node_shard_cnt. In order to make it easier for the user to use, a new, special value of transfers=0 will take care of that. It is set as the default, because we aim to make not configured restore as fast as possible.
This commit allows user to control the amount of rclone transfers used during restore. Moreover, during development days of restore task, the default value of --parallel flag was changed from 1 to 0, but we forgot to change it in the flag documentation.
This is the first step to control transfers in the context of backup.
This commit requires changes in the usage of RcloneMoveDir in backup pkg.
This commit allows user to control the amount of rclone transfers used during backup.
…th transfers This way this test also checks transfers before and after backup. It also checks transfers before, in the middle, when paused, when resumed, and after restore. This required some changes to the test like swapping src and dst cluster (increase batch count) and hanging on LAS instead of copy paths (transfer change is applied as a part of copy paths).
1506638
to
dd3bab2
Compare
This PR is using #4068 for extended rclone API.
This PR allows for setting rate limit/transfers on rclone API calls used for uploading/downloading during backup/restore. This is preferred to setting transfers once on the start of backup/restore because it is more resilient to agent restarts. Moreover, it is now possible to check current transfers set
This PR allows for setting transfers in a similar fashion as setting rate limit - meaning that they are global property (in the node), as they need to be changed in global rclone config and in initialized
fs.Fs
objects. We can't set them just in the context of a single rclone API call.Fixed issue describes the need to allow for setting transfers only during restore, but because of the above, transfers also need be re-set during backup (so that backup does not use the transfers set by restore). Because of that, I decided to make transfers configurable not only in restore, but also in backup.
Transfers can be set to a special value
-1
- meaning that the transfers specified in rclone config file should be used.For restore, there is another special value
0
- mean that transfers should be set so that we get the fastest download resulting intransfers=2*node_shard_cnt
.The default value for
--transfers
for backup is-1
, and0
for restoreFixes #3948