Skip to content

1 1 restore feature branch #4349

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

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
3 changes: 3 additions & 0 deletions .github/cfg/integration-test-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ jobs:

- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate

- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-2023.1.11-IPV4-raftschema
"on":
pull_request:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-tests-2023.1.11-IPV4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-2023.1.11-IPV4
"on":
pull_request:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-2023.1.11-IPV6-raftschema
"on":
pull_request:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-tests-2024.1.12-IPV4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-2024.1.12-IPV4
"on":
pull_request:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-tests-2024.1.12-IPV6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-2024.1.12-IPV6
"on":
pull_request:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-2025.1.0-rc4-IPV4-tablets-nossl
"on":
pull_request:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-tests-2025.1.0-rc4-IPV6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-2025.1.0-rc4-IPV6
"on":
pull_request:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-tests-6.2.0-IPV4-tablets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-6.2.0-IPV4-tablets
"on":
pull_request:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-tests-6.2.0-IPV4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-6.2.0-IPV4
"on":
pull_request:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
run: make pkg-integration-test PKG=./pkg/store
- name: Run migrate tests
run: make pkg-integration-test PKG=./pkg/schema/migrate
- name: Run 1-1-restore tests
run: make pkg-integration-test TABLETS=${{ env.tablets }} PKG=./pkg/service/one2onerestore
name: integration-tests-6.2.0-IPV6-tablets-nossl
"on":
pull_request:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ integration-test:
@$(MAKE) pkg-integration-test PKG=./pkg/scyllaclient
@$(MAKE) pkg-integration-test PKG=./pkg/service/backup
@$(MAKE) pkg-integration-test PKG=./pkg/service/restore
@$(MAKE) pkg-integration-test PKG=./pkg/service/one2onerestore
@$(MAKE) pkg-integration-test PKG=./pkg/service/cluster
@$(MAKE) pkg-integration-test PKG=./pkg/service/healthcheck
@$(MAKE) pkg-integration-test PKG=./pkg/service/repair
Expand Down Expand Up @@ -143,6 +144,7 @@ pkg-integration-test:
-v "$(PWD)/$(PKG)/testdata:/integration-test/testdata" \
-w "/integration-test" \
-e "SSL_ENABLED=$(SSL_ENABLED)" \
-e "TABLETS=$(TABLETS)" \
-u $(CURRENT_UID):$(CURRENT_GID) \
-i --read-only --rm ubuntu integration-test -test.v -test.run $(RUN) $(INTEGRATION_TEST_ARGS) $(SSL_FLAGS) $(ARGS)

Expand Down
1 change: 1 addition & 0 deletions docs/source/sctool/partials/sctool_restore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,5 @@ inherited_options:
If running sctool on the same machine as server, it's generated based on '/etc/scylla-manager/scylla-manager.yaml' file.
see_also:
- sctool - Scylla Manager Snapshot
- sctool restore 1-1-restore - Run an ad-hoc restore of tables to a cluster that mirrors the topology (DCs, racks, nodes structure and tokens) of a backup cluster.
- sctool restore update - Modify properties of the existing restore task
143 changes: 143 additions & 0 deletions docs/source/sctool/partials/sctool_restore_1-1-restore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: sctool restore 1-1-restore
synopsis: |
Run an ad-hoc restore of tables to a cluster that mirrors the topology (DCs, racks, nodes structure and tokens) of a backup cluster.
description: "This command allows you to run ad-hoc restore of tables to a cluster that mirrors the topology of a backup cluster. This means that the target cluster must have \nthe same number of nodes in each datacenter and rack, as well as the same token assignment for each node. \n**Note:** This command only restores the data within the tables. \nYou must first restore the schema of the database separately using the regular restore command with the `--restore-schema` flag.\n"
usage: sctool restore 1-1-restore --cluster <id|name> --location [<dc>:]<provider>:<bucket> --snapshot-tag <tag> [flags] --source-cluster-id <id> --nodes-mapping <filepath>
options:
- name: cluster
shorthand: c
usage: |
The target cluster `name or ID` (envvar SCYLLA_MANAGER_CLUSTER).
- name: cron
usage: |
Task schedule as a cron `expression`.
It supports the extended syntax including @monthly, @weekly, @daily, @midnight, @hourly, @every X[h|m|s].
- name: dry-run
default_value: "false"
usage: |
Validates and displays restore information without actually running the restore.
This allows you to display what will happen should the restore run with the parameters you set.
- name: enabled
default_value: "true"
usage: |
Not enabled tasks are not executed and are hidden from the task list.
- name: help
shorthand: h
default_value: "false"
usage: help for 1-1-restore
- name: interval
shorthand: i
usage: |
--interval is deprecated, please use `--cron` instead


Time after which a successfully completed task would be run again. The supported units are:

* 'd' - days
* 'h' - hours
* 'm' - minutes
* 's' - seconds
* 'ms' - milliseconds

The task run date is aligned with '--start date' value.
For example, if you select '--interval 7d' task would run weekly at the '--start-date' time.
- name: keyspace
shorthand: K
default_value: '[]'
usage: |+
A list of `glob` patterns separated by a comma used to include or exclude tables.
The patterns match keyspaces and tables, separate the keyspace name from the table name with a dot e.g. 'keyspace,!keyspace.table_prefix_*'.
The following syntax for glob patterns is supported:

* '*' - matches any number of any characters including none
* '?' - matches any single character
* '[abc]' - matches one character given in the bracket
* '[a-z]' - matches one character from the range given in the bracket

Patterns are evaluated from left to right.
If a pattern starts with '!' it unselects items that were selected by previous patterns i.e. 'a?,!aa' selects *ab* but not *aa*.

- name: label
usage: |
A comma-separated list of label modifications. Labels are represented as a key-value store.
Character '=' has a special meaning and cannot be a part of label's key nor value.
A single modification takes form of:
* '<key>=<value>' - sets the label <key> to <value>
* '<key>-' - removes the label

For example, '--label k1=v1,k2-' will set the label 'k1' to 'v1' and will also remove label 'k2'.
- name: location
shorthand: L
default_value: '[]'
usage: |
A list of backup locations separated by a comma, specifies places where restored backup is stored.

The format is `[<dc>:]<provider>:<bucket>`.
The `<dc>` parameter will be ignored and nodes-mapping will be used instead.
- name: name
usage: |
Task name that can be used instead of ID.
- name: nodes-mapping
usage: |
Path to a file with source cluster and target cluster nodes mapping. Each line should contain node mapping in the following format <source_dc>:<source_rack>:<source_host_id>=<destination_dc>:<destination_rack>:<destination_host_id>
- name: num-retries
shorthand: r
default_value: "3"
usage: |
Number of times a task reruns following a failure.
- name: retry-wait
default_value: 10m
usage: |
Initial exponential backoff `duration` X[h|m|s].
With --retry-wait 10m task will wait 10 minutes, 20 minutes and 40 minutes after first, second and third consecutire failure.
- name: snapshot-tag
shorthand: T
usage: |
Scylla Manager snapshot tag identifying restored backup.
Snapshot tags can be obtained from backup listing ('./sctool backup list' command - e.g. sm_20060102150405UTC).
- name: source-cluster-id
usage: |
Cluster ID of the backup cluster.
- name: start-date
shorthand: s
usage: |
The date can be expressed relatively to now or as a RFC3339 formatted string.
To run the task in 2 hours use 'now+2h'. The supported units are:

* 'd' - days
* 'h' - hours
* 'm' - minutes
* 's' - seconds
* 'ms' - milliseconds

If you want the task to start at a specified date use RFC3339 formatted string i.e. '2018-01-02T15:04:05-07:00'.
If you want the repair to start immediately, use the value 'now' or skip this flag.
- name: timezone
default_value: UTC
usage: |
Timezone of --cron and --window flag values.
The default value is taken from this system, namely 'TZ' envvar or '/etc/localtime' file.
- name: window
default_value: '[]'
usage: |
A comma-separated list of time markers in a form `[WEEKDAY-]HH:MM`.
WEEKDAY can be written as the whole word or only using the first 3 characters, HH:MM is an hour from 00:00 to 23:59.

* 'MON-00:00,FRI-15:00' - can be executed from Monday to Friday 3PM
* '23:00,06:00' - can be executed every night from 11PM to 6AM
* '23:00,06:00,SAT-00:00,SUN-23:59' - can be executed every night from 11PM to 6AM and all day during the weekend
inherited_options:
- name: api-cert-file
usage: |
File `path` to HTTPS client certificate used to access the Scylla Manager server when client certificate validation is enabled (envvar SCYLLA_MANAGER_API_CERT_FILE).
- name: api-key-file
usage: |
File `path` to HTTPS client key associated with --api-cert-file flag (envvar SCYLLA_MANAGER_API_KEY_FILE).
- name: api-url
default_value: http://127.0.0.1:5080/api/v1
usage: |
Base `URL` of Scylla Manager server (envvar SCYLLA_MANAGER_API_URL).
If running sctool on the same machine as server, it's generated based on '/etc/scylla-manager/scylla-manager.yaml' file.
see_also:
- sctool restore - Run an ad-hoc restore of schema or tables
- sctool restore 1-1-restore update - Modify properties of the existing 1-1-restore task
Loading
Loading