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

[YSQL] Avoid sending multiple Perform RPC simultaneously #12327

Closed
d-uspenskiy opened this issue Apr 29, 2022 · 0 comments
Closed

[YSQL] Avoid sending multiple Perform RPC simultaneously #12327

d-uspenskiy opened this issue Apr 29, 2022 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@d-uspenskiy
Copy link
Contributor

d-uspenskiy commented Apr 29, 2022

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

Description

In context of #11886 issue optimization for using tserver's read time has been introduced.
This optimization may work incorrectly in case YSQL runs multiple Perform RPC simultaneously.

PgClientService analyzes number of tablets which will be used by first read request in the transaction. In case of read from single tablet read time will be selected by tablet's tserver and in case of read multiple tablets read time will be selected locally.
Running multiple Perform RPCs simultaneously may break the mechanism of choosing read time because each of the Perform RPC may read from single tablet by actually read will be performed from multiple tablets.

@d-uspenskiy d-uspenskiy added kind/enhancement This is an enhancement of an existing feature area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Apr 29, 2022
@d-uspenskiy d-uspenskiy self-assigned this Apr 29, 2022
d-uspenskiy added a commit that referenced this issue May 17, 2022
Summary:
In context of the #11886 issue optimization for using tserver's read time has been introduced.
This optimization may work incorrectly in case YSQL runs multiple `Perform` RPC simultaneously.

`PgClientService` analyzes number of tablets which will be used by first read request in the transaction. In case of read from single tablet read time will be selected by tablet's tserver and in case of read multiple tablets read time will be selected locally.
Running multiple `Perform` RPCs simultaneously may break the mechanism of choosing read time because each of the `Perform` RPC may read from single tablet by actually read will be performed from multiple tablets.

For optimization purposes in case of foreign key check reading from multiple tables in parallel was introduced in context of the #11470 issue. Current version sends multiple `Perform` RPCs simultaneously.

Current diff preserves reading from multiple tables in parallel by uses single `Perform` RPCs for this purpose.

Test Plan:
New unit test is introduced

```
./yb_build.sh --gtest_filter PgFKeyTest.MultipleFKConstraintRPCCount
./yb_build.sh --gtest_filter PgFKeyTest.InsertWithLargeNumberOfFK
```

Reviewers: sergei, alex, lnguyen

Reviewed By: lnguyen

Subscribers: ssong, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D16751
@yugabyte-ci yugabyte-ci added the priority/medium Medium priority issue label May 17, 2022
d-uspenskiy added a commit that referenced this issue May 26, 2022
…mic table split

Summary:
In context of the change D16751 / 4e11189 redundant sorting of ybctids (before calling of the `PgDocOp::PopulateDmlByYbctidOps` method) was removed. But this change highlighted the problem that in case ybctids is not sorted read result might be incomplete in case of dynamic table split. The issue #12648 is created to solve the problem and create unit tests.
Current change restores code with ybctids sorting as a workaround to unblock TPC-C benchmark.

Test Plan:
Jenkins

Unit test will be added withing the context of fix for #12648

Reviewers: lnguyen

Reviewed By: lnguyen

Subscribers: smishra, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D17142
lnguyen-yugabyte pushed a commit that referenced this issue May 28, 2022
…in case of dynamic table split

Summary:
Original commit: D17142 / 17f7b80

In context of the change D16751 / 4e11189 redundant sorting of ybctids (before calling of the `PgDocOp::PopulateDmlByYbctidOps` method) was removed. But this change highlighted the problem that in case ybctids is not sorted read result might be incomplete in case of dynamic table split. The issue #12648 is created to solve the problem and create unit tests.
Current change restores code with ybctids sorting as a workaround to unblock TPC-C benchmark.

Test Plan:
Jenkins

Unit test will be added withing the context of fix for #12648

Reviewers: dmitry, hbhanawat, rthallam

Reviewed By: rthallam

Subscribers: yql, smishra

Differential Revision: https://phabricator.dev.yugabyte.com/D17251
@yugabyte-ci yugabyte-ci removed the status/awaiting-triage Issue awaiting triage label Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants