Skip to content

Commit

Permalink
feat(command/backup): add --transfers flag
Browse files Browse the repository at this point in the history
This commit allows user to control the amount of rclone transfers used during backup.
  • Loading branch information
Michal-Leszczynski committed Oct 8, 2024
1 parent aec484e commit 7da42bb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/source/sctool/partials/sctool_backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ options:
usage: |
Timezone of --cron and --window flag values.
The default value is taken from this system, namely 'TZ' envvar or '/etc/localtime' file.
- name: transfers
default_value: "2"
usage: |
Sets the amount of file transfers to run in parallel when uploading files from a Scylla node to its backup location.
- name: upload-parallel
default_value: '[]'
usage: |
Expand Down
4 changes: 4 additions & 0 deletions docs/source/sctool/partials/sctool_backup_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ options:
usage: |
Timezone of --cron and --window flag values.
The default value is taken from this system, namely 'TZ' envvar or '/etc/localtime' file.
- name: transfers
default_value: "2"
usage: |
Sets the amount of file transfers to run in parallel when uploading files from a Scylla node to its backup location.
- name: upload-parallel
default_value: '[]'
usage: |
Expand Down
6 changes: 6 additions & 0 deletions pkg/command/backup/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type command struct {
retention int
retentionDays int
rateLimit []string
transfers int
snapshotParallel []string
uploadParallel []string
dryRun bool
Expand Down Expand Up @@ -84,6 +85,7 @@ func (cmd *command) init() {
w.Unwrap().IntVar(&cmd.retention, "retention", 7, "")
w.Unwrap().IntVar(&cmd.retentionDays, "retention-days", 0, "")
w.Unwrap().StringSliceVar(&cmd.rateLimit, "rate-limit", nil, "")
w.Unwrap().IntVar(&cmd.transfers, "transfers", 2, "")
w.Unwrap().StringSliceVar(&cmd.snapshotParallel, "snapshot-parallel", nil, "")
w.Unwrap().StringSliceVar(&cmd.uploadParallel, "upload-parallel", nil, "")
w.Unwrap().BoolVar(&cmd.dryRun, "dry-run", false, "")
Expand Down Expand Up @@ -144,6 +146,10 @@ func (cmd *command) run(args []string) error {
props["rate_limit"] = cmd.rateLimit
ok = true
}
if cmd.Flag("transfers").Changed {
props["transfers"] = cmd.transfers
ok = true
}
if cmd.Flag("snapshot-parallel").Changed {
props["snapshot_parallel"] = cmd.snapshotParallel
ok = true
Expand Down
3 changes: 3 additions & 0 deletions pkg/command/backup/res.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ rate-limit: |
The <dc>: part is optional and is only needed when different datacenters require different upload limits.
Set to 0 for no limit (default 100).
transfers: |
Sets the amount of file transfers to run in parallel when uploading files from a Scylla node to its backup location.
snapshot-parallel: |
A comma-separated list of snapshot parallelism limits in the format `[<dc>:]<limit>`.
The ``dc`` part is optional and allows for specifying different limits in selected datacenters.
Expand Down

0 comments on commit 7da42bb

Please sign in to comment.