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

geo: Support deletion of local transaction tables #11123

Closed
es1024 opened this issue Jan 18, 2022 · 1 comment
Closed

geo: Support deletion of local transaction tables #11123

es1024 opened this issue Jan 18, 2022 · 1 comment
Assignees
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@es1024
Copy link
Contributor

es1024 commented Jan 18, 2022

Jira Link: DB-825

Description

Context: #9980 #10783

We currently do not have any way of safely deleting a transaction status table, which means that transaction tables created through CREATE TABLESPACE will remain even after DROP TABLESPACE (though unused). We should identify transaction status tables left behind from a dropped tablespace and delete them automatically when safe.

@es1024 es1024 added the area/docdb YugabyteDB core features label Jan 18, 2022
@es1024 es1024 self-assigned this Jan 18, 2022
@es1024 es1024 added this to To Do in Row Level Geo Partitioning via automation Jan 18, 2022
@omkar-yb omkar-yb added this to Backlog in YBase features Jan 19, 2022
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 8, 2022
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature and removed kind/bug This issue is a bug labels Jul 29, 2022
es1024 added a commit that referenced this issue Sep 29, 2022
Summary:
This diff makes the DeleteTable RPC (and by extension, `yb-admin delete_table`) work
safely for transaction tables.

Deletion of transaction tables is carried out in the following manner:

1. The table is marked as DELETING, and removed from the set of transaction tables used to pick
   status tablets for new transactions.
2. The transaction tables version is incremented, and propagated to all tservers. At this point,
   no newly created transactions will use any tablet from the transaction table being deleted.
3. A PrepareDeleteTransactionTablet RPC is sent to each status tablets' leader. This RPC waits
   for all running transactions to either abort, or commit and apply in all involved tablets.
4. DeleteTablet RPCs are sent out as usual to each replica of each tablet.

Step 3 ensures that all committed transactions' intents have been applied successfully, but does
not ensure that all aborted transactions' intents have been cleaned up. This diff modifies the
behavior of the transaction status resolver to assume all transactions on a transaction tablet
have been aborted, if the transaction tablet has been deleted.

Transaction tables are also now automatically deleted when a tablespace is dropped.

Test Plan: `ybd --gtest_filter GeoTransactionsTest.TestTransactionTableDeletion`

Reviewers: rsami, sergei, asrivastava

Reviewed By: sergei

Subscribers: ybase, bogdan

Differential Revision: https://phabricator.dev.yugabyte.com/D17791
@es1024
Copy link
Contributor Author

es1024 commented Sep 29, 2022

Implemented with 51ecb82.

@es1024 es1024 closed this as completed Sep 29, 2022
YBase features automation moved this from Backlog to Done Sep 29, 2022
Row Level Geo Partitioning automation moved this from To Do to Done Sep 29, 2022
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/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Development

No branches or pull requests

2 participants