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] Move YBCPgSession and PgTxnManager into PgApiImpl #3053

Closed
d-uspenskiy opened this issue Dec 3, 2019 · 0 comments
Closed

[YSQL] Move YBCPgSession and PgTxnManager into PgApiImpl #3053

d-uspenskiy opened this issue Dec 3, 2019 · 0 comments
Assignees

Comments

@d-uspenskiy
Copy link
Contributor

d-uspenskiy commented Dec 3, 2019

In context of #2934 aggressive buffering of write operation should be implemented.
Buffered operations will be stored in YBCPgSession object.
Buffering should also take transaction state into account. For example before committing transaction all buffered operations must be apply first, and in case transaction is rolled back buffered operations must be vanished.
To control write operation buffer state in YBCPgSession the following redesign should be implemented:

  • make YBCPgSession private member of PgApiImpl class
  • make PgTxnManager private member of PgApiImpl class
  • do not provide direct access to YBCPgSession PgTxnManager
  • create separate methods in PgApiImpl class to begin/commit/rollback transactions

With such approach PgApiImpl class will be able to clear/flush buffer of write operation in YBCPgSession object in case of transaction state changes.

@d-uspenskiy d-uspenskiy self-assigned this Dec 3, 2019
d-uspenskiy added a commit that referenced this issue Dec 19, 2019
Summary:
1. Global variable `ybc_pg_session` is removed.
Now `PgSession` object is stored as a member in `PgApiImpl` object.

2. Standalone functions for commit/rollback/abort transaction are created.
Now it is possible to notify `PgSession` object to flush/clear buffers in case of transaction state change.

Test Plan: Jenkins

Reviewers: mihnea, mikhail

Reviewed By: mikhail

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D7648
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant