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: Add ability to create new txn status tables #10157

Closed
bmatican opened this issue Oct 1, 2021 · 3 comments
Closed

geo: Add ability to create new txn status tables #10157

bmatican opened this issue Oct 1, 2021 · 3 comments
Assignees
Labels
area/docdb YugabyteDB core features

Comments

@bmatican
Copy link
Contributor

bmatican commented Oct 1, 2021

Context: #9980

We need to be able to create new txn status tables and set custom placement policies for them.

  • For creating them, we already have CatalogManager::CreateTransactionsStatusTableIfNeeded, so we could figure out how to reuse that / retrofit that. Perhaps a new yb-admin command that creates a similar CreateTableRPC.
  • For setting custom placement, we already have a yb-admin command to do just that, modify_table_placement_info, per table, which Deepthi added back when we added YCQL support for geo-partition.
@bmatican
Copy link
Contributor Author

bmatican commented Oct 1, 2021

An easy way to test this locally could be by using custom placement info per tserver. We can start a 1 node cluster in zone A, then start 2 new TS, one in zone B and 3rd in zone C. Then we can update the cluster placement to RF3 across zones A,B,C. This will apply to all new tables by default. Finally, we can create 3 new txn tables and then set placement on them to RF1 and place them 1 each in zones A, B and C.

In a unit test, this should also be pretty easy to replicate, as there we have explicit ways to start tservers with custom flags. cc @sanketkedia maybe for an example of test with custom placement.

@deeps1991
Copy link
Contributor

Small minor point:
modify_table_placement_info basically calls AlterTable under the hood to change the placement policy. Maybe its an easier user workflow to make the new yb-admin command we are going to use to create the TransactionStatusTablet itself to take placement options for the new table. Code from modify_table_placement_info can be refactored and reused for this purpose.

es1024 added a commit that referenced this issue Nov 1, 2021
Summary:
Added `yb-admin create_transaction_table` which creates a transaction status table
of the passed in name, e.g.

```
yb-admin create_transaction_table transactions_us
```
to create `system.transactions_us`.

This table's placement can be modified normally with `yb-admin modify_table_placement_info`.

Test Plan:
Added test to create three transaction tables with placement set in different zones.

`ybd --cxx-test tools_yb-admin-test --gtest_filter AdminCliTest.TestCreateTransactionStatusTablesWithPlacements`

Reviewers: bogdan, skedia, rthallam, dsrinivasan

Reviewed By: dsrinivasan

Subscribers: ybase

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

es1024 commented Nov 10, 2021

Added with 10f931b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features
Development

No branches or pull requests

3 participants