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

[bug] proxy: current way of detecting txn status is not robust #10486

Merged
merged 5 commits into from
Jul 7, 2023

Conversation

volgariver6
Copy link
Contributor

Reason: current way of detecting a connection is in active txn or not is by parse the SQL statement from client. If it matches begin, commit or rollback, we change the txn status. This way is not robust, because the statement may contains some comment strings.

Fix: check the txn status by the OK and EOF packet returned from server. Those packets contains the txn status. But currently, MO server does not set the status in OK and EOF packets correctly. So first, set the correty status in OK and EOF packets, then set the txn status in proxy session.

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #10015, #10164, https://github.com/matrixorigin/MO-Cloud/issues/957

What this PR does / why we need it:

@matrix-meow matrix-meow added the size/L Denotes a PR that changes [500,999] lines label Jul 7, 2023
@mergify mergify bot added the kind/bug Something isn't working label Jul 7, 2023
Reason: current way of detecting a connection is in active txn
or not is by parse the SQL statement from client. If it matches
begin, commit or rollback, we change the txn status. This way is
not robust, because the statement may contains some comment strings.

Fix: check the txn status by the OK and EOF packet returned from server.
Those packets contains the txn status. But currently, MO server
does not set the status in OK and EOF packets correctly. So first,
set the correty status in OK and EOF packets, then set the txn status
in proxy session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working size/L Denotes a PR that changes [500,999] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants