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] PITR: Disallow TRUNCATE #11777

Closed
bmatican opened this issue Mar 16, 2022 · 1 comment
Closed

[DocDB] PITR: Disallow TRUNCATE #11777

bmatican opened this issue Mar 16, 2022 · 1 comment
Assignees
Labels
area/docdb YugabyteDB core features

Comments

@bmatican
Copy link
Contributor

Description

Since TRUNCATE is not transactional and we do not yet have #7130, we should just disable TRUNCATE being executed against tables involved in PITR.

The work is likely to be similar to #8415.

@bmatican bmatican added the area/docdb YugabyteDB core features label Mar 16, 2022
@bmatican
Copy link
Contributor Author

Docs for trying out PITR: https://docs.yugabyte.com/latest/explore/cluster-management/point-in-time-recovery-ysql/

For the master side work, we'll probably need the same type of glue in CatalogManager::TruncateTable.

Feel free to reach out to @sanketkedia for more info on PITR.

Note: As per @frozenspider and @jaki , we'll need to also factor in, for all of these TRUNCATE paths, that colocation is a tserver-side DDL operation. Context: https://yugabyte.slack.com/archives/CAR5BCH29/p1647556951578069

However, would also be interesting to investigate, perhaps in a test, what happens if we send the master a TruncateTable RPC, for a colocated table? The code looks as if it warns, but then continues?

 4586   // Truncate on a colocated table should not hit master because it should be handled by a write
 4587   // DML that creates a table-level tombstone.
 4588   LOG_IF(WARNING, table->IsColocatedUserTable()) << "cannot truncate a colocated table on master";
...
 4597   // Send a Truncate() request to each tablet in the table.
 4598   SendTruncateTableRequest(table);

lingamsandeep added a commit that referenced this issue Apr 6, 2022
Summary:
Truncate Table will be disallowed on tables with a snapshot schedule as part of this change unless the flag to enable it is explicitly turned ON.

Note that this restriction currently does not yet apply to colocated tables which will be handled as part of a separate issue.

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

Reviewers: bogdan, skedia

Reviewed By: skedia

Subscribers: asrivastava, ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D16271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features
Projects
None yet
Development

No branches or pull requests

2 participants