Fix DDL Execution on reserved connection without in active transaction#6514
Merged
harshit-gangal merged 4 commits intovitessio:masterfrom Aug 10, 2020
Merged
Conversation
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
sougou
approved these changes
Aug 2, 2020
Contributor
sougou
left a comment
There was a problem hiding this comment.
You can merge after removing the TODO.
| if err != nil { | ||
| return nil, err | ||
| // Only perform this operation when the connection has transaction open. | ||
| // TODO: This actually does not retain the old transaction. We should see how to provide correct behaviour to client. |
Contributor
There was a problem hiding this comment.
You can remove the TODO. The DDL specs say that it's an implicit commit. So, this is correct behavior.
Member
Author
There was a problem hiding this comment.
The idea here it to not start a new transaction as the current existing transaction is committed. Instead VTGate session should clear out transaction details it is holding.
Collaborator
|
Please create a backport PR for 7.0. |
harshit-gangal
added a commit
to planetscale/vitess
that referenced
this pull request
Aug 12, 2020
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
deepthi
added a commit
that referenced
this pull request
Aug 12, 2020
backport #6514 to 7.0 release branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When in transaction on DDL execution we create a new transaction on the same connection before returning the result back to vtgate.
Reserved connection uses same connection. But, they may or may not be in active transaction. This caused the ddl exec to break in reserved connection.