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: ysql_upgrade returns nonlocal transaction error for geo-partitioned clusters #11730

Closed
es1024 opened this issue Mar 11, 2022 · 0 comments
Closed
Assignees
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug

Comments

@es1024
Copy link
Contributor

es1024 commented Mar 11, 2022

Description

When running ysql upgrade on a cluster over multiple regions with local transaction tables (which are now created automatically for all YSQL geo-partitioned clusters), the following error occurs:

message: ERROR:  Illegal state: Nonlocal tablet accessed in local transaction: tablet 00000000000000000000000000000000: . Errors from tablet servers: [Illegal state (yb/client/transaction.cc:286): Nonlocal tablet accessed in local transaction: tablet 00000000000000000000000000000000]

This is due to the upgrade running transactions that should be global, but which we currently assume to be local.

Context: #9980 #10158 #11353 #11731

@es1024 es1024 added kind/bug This issue is a bug area/docdb YugabyteDB core features labels Mar 11, 2022
@es1024 es1024 added this to To Do in Row Level Geo Partitioning via automation Mar 11, 2022
@es1024 es1024 self-assigned this Mar 11, 2022
es1024 added a commit that referenced this issue Mar 11, 2022
… geo-partitioned clusters

Summary:
Added force_global_transaction=true when running ysql_upgrade to avoid nonlocal transaction
errors on geo-partitioned clusters.

Test Plan: `ybd --java_test 'org.yb.pgsql.TestYsqlUpgrade#migrationInGeoPartitionedSetup' --clang11`

Reviewers: alex

Reviewed By: alex

Subscribers: dsrinivasan, bogdan, yql, ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D15935
@es1024 es1024 closed this as completed Mar 11, 2022
Row Level Geo Partitioning automation moved this from To Do to Done Mar 11, 2022
es1024 added a commit that referenced this issue Mar 11, 2022
… ysql_upgrade on geo-partitioned clusters

Summary:
Added force_global_transaction=true when running ysql_upgrade to avoid nonlocal transaction
errors on geo-partitioned clusters.

Original commit: D15935 / 4c44705

Test Plan:
Jenkins: rebase: 2.12

`ybd --java_test 'org.yb.pgsql.TestYsqlUpgrade#migrationInGeoPartitionedSetup' --clang11`

Reviewers: alex, bogdan, rthallam

Reviewed By: rthallam

Subscribers: rthallam, ybase, yql, dsrinivasan

Differential Revision: https://phabricator.dev.yugabyte.com/D15936
es1024 added a commit that referenced this issue Mar 11, 2022
…ng ysql_upgrade on geo-partitioned clusters

Summary:
Added force_global_transaction=true when running ysql_upgrade to avoid nonlocal transaction
errors on geo-partitioned clusters.

Original commit: D15935 / 4c44705

Test Plan:
Jenkins: rebase: 2.13.0

`ybd --java_test 'org.yb.pgsql.TestYsqlUpgrade#migrationInGeoPartitionedSetup' --clang11`

Reviewers: alex, bogdan, rthallam

Reviewed By: rthallam

Subscribers: steve.varnau, rthallam, dsrinivasan, yql, ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D15937
es1024 added a commit that referenced this issue May 13, 2022
…m transaction pool

Summary:
Added passing information about locality of statements from Postgres layer to PGGate, and
modified PgClientSession to use this information to take a transaction from the global transaction
pool instead of the local transaction pool when the first statement of a transaction is not
operating on data from the same region.

Also removed the temporary fix added with D15935 / 4c44705 (#11730).

This also fixes #11947 since the nonlocal error is no longer raised in YSQL upgrade in the first place.

Test Plan:
Updated tests in `GeoTransactionsTest` to do local then global operations instead of just
global (which now always starts as global instead), and added a few new checks for the first
operation global case in `GeoTransactionsTest.TestTransactionTabletSelection`:

`ybd --cxx-test pgwrapper_geo_transactions-test --gtest_filter GeoTransactionsTest.TestTransactionTabletSelection`

Ran test added in D15935 / 4c44705 (#11730) to verify everything
works even with temporary fix removed.

`ybd --java_test 'org.yb.pgsql.TestYsqlUpgrade#migrationInGeoPartitionedSetup'`

Verified #11947 is fixed by running:

`ybd --java-test TestYsqlUpgrade`

Reviewers: alex, dsrinivasan, dmitry

Reviewed By: dmitry

Subscribers: rthallam, bogdan, yql, ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D16200
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
Development

No branches or pull requests

1 participant