-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix DDL Execution on reserved connection without in active transaction #6514
Fix DDL Execution on reserved connection without in active transaction #6514
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the TODO. The DDL specs say that it's an implicit commit. So, this is correct behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Please create a backport PR for 7.0. |
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
backport #6514 to 7.0 release branch
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.