-
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
[Gen4] Fix lookup vindexes with autocommit
enabled
#12172
[Gen4] Fix lookup vindexes with autocommit
enabled
#12172
Conversation
autocommit
vindexes after savepoint creationautocommit
vindexes after savepoint creation
autocommit
vindexes after savepoint creationautocommit
enabled
0434014
to
20f66aa
Compare
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
20f66aa
to
6c72940
Compare
go/vt/vtgate/vindexes/vindex.go
Outdated
AllowBatch() bool | ||
GetCommitOrder() vtgatepb.CommitOrder | ||
} |
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.
All the dead code implementations of AllowBatch
and GetCommitOrder
from the vindexes should also be removed.
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.
Ignore this comment. We have to move autocommit logic as well from Map function to vindex_lookup engine primitive.
6b480af
to
26d1e0c
Compare
@harshit-gangal I took a different approach and simply re-implemented the autocommit logic inside the I'm not 100% happy with the code duplication that's going on. It would be nice to refactor this further so that both the old API for lookup vindexes and the new API can share the same code / logic so that any future issues only need to be fixed in one place. |
@harshit-gangal I think this is ready for another review. With the latest commit I pushed, all test cases should also be passing now. 🤞 |
autocommit
enabledautocommit
enabled
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.
One comment rest looks good.
…fter a savepoint is created Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
…tions Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
…`vexplain` output. Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
eeb17f6
to
8f925ac
Compare
…12172) (#12230) * test: show that `autocommit` on lookup vindexes is broken when used after a savepoint is created Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> * test: rework the test case to show that the problem lies with transactions Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> * Correctly handle `autocommit` in the `VIndexLookup` primitive. Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> * Copy the `logging` struct so autocommit queries show up correctly in `vexplain` output. Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> --------- Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com>
Description
The
VindexLookup
primitive re-implemented some parts of the lookup vindex functionality, but missed to honor theautocommit
flag. This pull request changesVindexLookup
to re-use existing logic instead of using a separate implementation.Related Issue(s)
autocommit
are not working correctly with Gen4 planner #12173Checklist
Deployment Notes