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: Automatically promote local transactions to global transactions #10537

Closed
es1024 opened this issue Nov 10, 2021 · 1 comment
Closed

geo: Automatically promote local transactions to global transactions #10537

es1024 opened this issue Nov 10, 2021 · 1 comment
Assignees
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@es1024
Copy link
Contributor

es1024 commented Nov 10, 2021

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

Description

Context: #9980, #10158, #10159

We support marking YSQL transactions as local vs global to take advantage of region-local transaction tables and get region-local latencies for writes, but currently require the user to indicate which transactions are global via setting the session variable force_global_transaction = true. We should automatically promote local transactions to global transactions so that all transactions can succeed under force_global_transaction = false.

@es1024 es1024 added the area/docdb YugabyteDB core features label Nov 10, 2021
@es1024 es1024 self-assigned this Nov 10, 2021
es1024 added a commit that referenced this issue May 16, 2022
…sactions

Summary:
Added automatic promotion of local transactions into global transactions on first nonlocal write.

This is gated by the newly added `auto_promote_nonlocal_transactions_to_global` gflag.

Transactions undergoing the promotion process are temporarily blocked until a new status tablet
is picked, looked up, and an initial heartbeat is sent to the new status tablet. PENDING heartbeats
to the old status tablet continue until all participant tablets are notified about the change in
status tablets, then an abort is sent to just the old status tablet. Commit is blocked until
notification to participant tablets is complete and we abort instead if we are unable to be sure that
the old status tablet did not expire the transaction prematurely.

Participant tablets perform a replicated write to the transaction metadata in the intent store with
the new status tablet id when notified about the move in transaction status.

Test Plan: `ybd --cxx-test pgwrapper_geo_transactions_promotion-test --gtest_filter GeoTransactionsPromotionTest.\*`

Reviewers: sergei

Reviewed By: sergei

Subscribers: mbautin, ybase, rthallam, bogdan

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

es1024 commented May 16, 2022

Added with 5f339ee.

@es1024 es1024 closed this as completed May 16, 2022
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels May 16, 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/bug This issue is a bug priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants