Skip to content
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

[YSQL] Backups: Add --ignore_existing_tablespaces flag #20334

Closed
1 task done
OlegLoginov opened this issue Dec 16, 2023 · 0 comments
Closed
1 task done

[YSQL] Backups: Add --ignore_existing_tablespaces flag #20334

OlegLoginov opened this issue Dec 16, 2023 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@OlegLoginov
Copy link
Contributor

OlegLoginov commented Dec 16, 2023

Jira Link: DB-9319

Description

Top level GHI: #20333

The new flag allows to ignore existing TABLESPACEs during the YSQL DB backup-restore.
Affected components: ysql_dumpall binary tool, yb_backup.py script.

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@OlegLoginov OlegLoginov added the area/ysql Yugabyte SQL (YSQL) label Dec 16, 2023
@OlegLoginov OlegLoginov self-assigned this Dec 16, 2023
@OlegLoginov OlegLoginov added this to Backlog in YSQL via automation Dec 16, 2023
@OlegLoginov OlegLoginov added this to To do in Backups via automation Dec 16, 2023
@OlegLoginov OlegLoginov added this to To Do in Row Level Geo Partitioning via automation Dec 16, 2023
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue labels Dec 16, 2023
OlegLoginov added a commit that referenced this issue Dec 22, 2023
Summary:
Changes:
1. The new flag `--ignore_existing_tablespaces` is added into `yb_backup.py` script.
2. `ysql_dumpall` tool  is changed to dump Tablespaces with `if (ignore_existing_tablespaces)` statement.

The changes allow ignoring errors like `tablespace "region1_ts1" already exists`
when the backup-restore recreates the YSQL Tablespaces.

NOTE: "STOP_ON_ERROR" should be enabled to see the effect.
(set variable `ENABLE_STOP_ON_YSQL_DUMP_RESTORE_ERROR` into `True` in the `yb_backup.py`. Now it's `False`.)
Jira: DB-9319

Test Plan:
Set `ENABLE_STOP_ON_YSQL_DUMP_RESTORE_ERROR=True` in `yb_backup.py`.

New tests:
ybd --java-test  org.yb.pgsql.TestYbBackup#testFailureOnExistingTablespaces
ybd --java-test  org.yb.pgsql.TestYbBackup#testIgnoreExistingTablespaces
ybd --java-test  org.yb.pgsql.TestYsqlDump#ysqlDumpAllWithoutYbMetadata

Other related tests
ybd --java-test  org.yb.pgsql.TestYsqlDump#ysqlDumpAllWithYbMetadata

ybd --java-test  org.yb.pgsql.TestYbBackup#testGeoPartitioning
ybd --java-test  org.yb.pgsql.TestYbBackup#testGeoPartitioningNoRegions
ybd --java-test  org.yb.pgsql.TestYbBackup#testGeoPartitioningOneRegion
ybd --java-test  org.yb.pgsql.TestYbBackup#testGeoPartitioningRestoringIntoExisting
ybd --java-test  org.yb.pgsql.TestYbBackup#testGeoPartitioningWithTablespaces
ybd --java-test  org.yb.pgsql.TestYbBackup#testGeoPartitioningNoRegionsWithTablespaces
ybd --java-test  org.yb.pgsql.TestYbBackup#testGeoPartitioningOneRegionWithTablespaces
ybd --java-test  org.yb.pgsql.TestYbBackup#testGeoPartitioningRestoringIntoExistingWithTablespaces

Reviewers: mihnea, tverona, yguan

Reviewed By: yguan

Subscribers: yugaware, yql

Differential Revision: https://phorge.dev.yugabyte.com/D30956
YSQL automation moved this from Backlog to Done Dec 26, 2023
Backups automation moved this from To do to Done Dec 26, 2023
Row Level Geo Partitioning automation moved this from To Do to Done Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
Backups
  
Done
YSQL
  
Done
Development

No branches or pull requests

2 participants