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

[DocDB] Prevent tablespace deletion in case PITR is enabled #12508

Closed
vkulichenko opened this issue May 13, 2022 · 0 comments
Closed

[DocDB] Prevent tablespace deletion in case PITR is enabled #12508

vkulichenko opened this issue May 13, 2022 · 0 comments
Assignees
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@vkulichenko
Copy link
Contributor

vkulichenko commented May 13, 2022

Jira Link: [DB-342](https://yugabyte.atlassian.net/browse/DB-342)

Description

Tablespaces are currently not restored by PITR, so the following scenario leads to an unworkable state:

  1. Create a tablespace.
  2. Create a DB with a table assigned to the tablespace.
  3. Enable PITR (create a schedule).
  4. Drop the table and the tablespace.
  5. Restore to the point in time before tablespace is dropped.

Since tablespace is not restored, table recovery also fails. We need to guard this by prohibiting tablespace removal in case there is a schedule on one of the databases.

@vkulichenko vkulichenko added area/docdb YugabyteDB core features status/awaiting-triage Issue awaiting triage labels May 13, 2022
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels May 13, 2022
@yugabyte-ci yugabyte-ci removed the status/awaiting-triage Issue awaiting triage label May 24, 2022
sanketkedia added a commit that referenced this issue May 28, 2022
…hedules

Summary:
Since Tablespaces are global, they are currently not restored by PITR,
so the following scenario leads to an unworkable state:

1. Create a tablespace.
2. Create a DB with a table assigned to the tablespace.
3. Enable PITR (create a schedule).
4. Drop the table and the tablespace.
5. Restore to the point in time before tablespace is dropped.

Since tablespace is not restored, table recovery also fails. This diff guards against this by
preventing users from dropping tablespaces if the cluster has one or more PITR Schedules. Also,
added tests to verify restoration for cases with tablespaces.

Test Plan:
ybd --cxx_test yb-admin-snapshot-schedule-test --gtest-filter YbAdminSnapshotScheduleTest.PgsqlPreventTablespaceDrop
ybd --cxx_test yb-admin-snapshot-schedule-test --gtest-filter YbAdminSnapshotScheduleTest.PgsqlRestoreDroppedTableWithTablespace

Reviewers: bogdan, sergei, dsrinivasan, slingam

Reviewed By: dsrinivasan, slingam

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D17220
sanketkedia added a commit that referenced this issue Jun 1, 2022
…rs with PITR Schedules

Summary:
Since Tablespaces are global, they are currently not restored by PITR,
so the following scenario leads to an unworkable state:

1. Create a tablespace.
2. Create a DB with a table assigned to the tablespace.
3. Enable PITR (create a schedule).
4. Drop the table and the tablespace.
5. Restore to the point in time before tablespace is dropped.

Since tablespace is not restored, table recovery also fails. This diff guards against this by
preventing users from dropping tablespaces if the cluster has one or more PITR Schedules. Also,
added tests to verify restoration for cases with tablespaces.

Original commit: ac0d293 / D17220

Test Plan:
Jenkins: rebase: 2.14
Jenkins: urgent

Reviewers: bogdan, sergei, dsrinivasan, slingam

Reviewed By: slingam

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D17284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

3 participants