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] org.yb.pgsql.TestPgReadRestarts test is broken #3991

Closed
d-uspenskiy opened this issue Mar 17, 2020 · 0 comments
Closed

[YSQL] org.yb.pgsql.TestPgReadRestarts test is broken #3991

d-uspenskiy opened this issue Mar 17, 2020 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)

Comments

@d-uspenskiy
Copy link
Contributor

Test fails with the following error

org.postgresql.util.PSQLException: ERROR: IO error: Errors occured while reaching out to the tablet servers: . Errors from tablet servers: [Operation failed. 
Try again. (yb/docdb/conflict_resolution.cc:71): e4552f37-0bc4-4b83-8a00-2b95904fca37 Conflicts with higher priority transaction: 1fadf177-d727-45d2-aab1-c1f5
605e67b4 (transaction error 3), Operation failed. Try again. (yb/docdb/conflict_resolution.cc:71): e4552f37-0bc4-4b83-8a00-2b95904fca37 Conflicts with higher 
priority transaction: e3b525ca-28d6-4275-a0ba-b491b5e8fdc8 (transaction error 3)]

Reason: After parallelizing SELECT requests in some scenarios (SELECT COUNT(*) for example) multiple read commands can fail in one batch. PgSession class returns wrong status ins this case and restart mechanism can't restart operation.

@d-uspenskiy d-uspenskiy added the area/ysql Yugabyte SQL (YSQL) label Mar 17, 2020
@d-uspenskiy d-uspenskiy self-assigned this Mar 17, 2020
d-uspenskiy added a commit that referenced this issue Mar 19, 2020
…ead operations

Summary:
For now `SELECT` command can generate multiple `PgDocReadOp` and execute them in single batch by calling `PgSession::RunAsync` method which takes list of operations.
These read operations can conflicts with running transaction. Status for these operations will be `Status::TryAgain` with appropriate error code(s). It could be `YBPgErrorCode`, `TransactionErrorCode` or other.
`PgSession` return single status as a result of `PgSession::RunAsync` method. Base of this status upper level will try to restart operations in case no data was sent to users.
In case all failed operations has status with same code and same additional error codes single status is returned  with same this code and additional error codes. Message of new status enumerates all error statuses with prefix `Multiple homogeneous errors`.

Example: single `TryAgain` status constructed from 2 homogeneous statuses (status messages may be different):
```
Operation failed. Try again. (yb/yql/pggate/pg_session.cc:169): Multiple homogeneous errors: [
Operation failed. Try again. (yb/tablet/running_transaction.cc:385): Transaction aborted: b8f9ae55-3c84-4ed6-8354-fafbb8cb803f (pgsql error 25P02),
Operation failed. Try again. (yb/tablet/transaction_participant.cc:263): Unknown transaction, could be recently aborted: b8f9ae55-3c84-4ed6-8354-fafbb8cb803f (pgsql error 25P02)] (pgsql error 25P02)
```

Test Plan:
Run existed unit test

`./yb_build.sh --java-test org.yb.pgsql.TestPgReadRestarts#selectCountPrepared`

Reviewers: raju, mihnea, alex

Reviewed By: alex

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D8144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
None yet
Development

No branches or pull requests

1 participant