enable select for update in autocommit mode#3265
Closed
demmer wants to merge 1 commit intovitessio:masterfrom
Closed
enable select for update in autocommit mode#3265demmer wants to merge 1 commit intovitessio:masterfrom
demmer wants to merge 1 commit intovitessio:masterfrom
Conversation
Add support for autocommit mode and select for update transactions which is needed in cases where a DML is issued on a table with an owned secondary vindex, since the vtgate will first issue a query to get the index value from the primary row before trying to delete it.
sougou
reviewed
Sep 30, 2017
Contributor
sougou
left a comment
There was a problem hiding this comment.
autocommit at vttablet level is deprecated (and highly discouraged). We introduced it to support certain v2 operations, but this totally fails for v3 operations that may have lookup updates, etc.
The v3 autocommit happens through the session object. Also, it's a common misunderstanding that select for update locks the row. In reality, no lock is obtained because the statement is immediately 'commited': https://dev.mysql.com/doc/refman/5.7/en/innodb-locking-reads.html,
Member
Author
|
Ah -- this makes much more sense and exposes a design flaw in the current vtexplain implementation. Will replace with a better approach. |
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.
Add support for autocommit mode and select for update transactions
which is needed in cases where a DML is issued on a table with an
owned secondary vindex, since the vtgate will first issue a query
to get the index value from the primary row before trying to delete
it.