Skip to content

fix(manager): apply dc-mapping only if restoring tables, not schema #10621

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mgmt_cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ def restore_backup_without_manager(self, mgr_cluster, snapshot_tag, ks_tables_li
def restore_backup_with_task(self, mgr_cluster, snapshot_tag, timeout, restore_schema=False, restore_data=False,
location_list=None, extra_params=None):
location_list = location_list if location_list else self.locations
dc_mapping = self.get_dc_mapping()
dc_mapping = self.get_dc_mapping() if restore_data else None
restore_task = mgr_cluster.create_restore_task(restore_schema=restore_schema, restore_data=restore_data,
location_list=location_list, snapshot_tag=snapshot_tag,
dc_mapping=dc_mapping, extra_params=extra_params)
Expand Down
4 changes: 3 additions & 1 deletion sdcm/mgmt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,9 @@ def create_restore_task(self, restore_schema=False, restore_data=False, location
cmd += " --location {} ".format(locations_names)
if snapshot_tag:
cmd += f" --snapshot-tag {snapshot_tag}"
if dc_mapping:
if dc_mapping and restore_data:
# --dc-mapping flag is applicable only for --restore-tables mode
# https://manager.docs.scylladb.com/stable/sctool/restore.html#dc-mapping
cmd += f" --dc-mapping {dc_mapping}"
if extra_params:
cmd += f" {extra_params}"
Expand Down