-
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
Support SHOW VITESS_MIGRATIONS
from inside a transaction
#16399
Support SHOW VITESS_MIGRATIONS
from inside a transaction
#16399
Conversation
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Could we add an end-to-end test that checks this issue? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16399 +/- ##
==========================================
+ Coverage 68.66% 68.68% +0.02%
==========================================
Files 1548 1548
Lines 199084 199092 +8
==========================================
+ Hits 136699 136753 +54
+ Misses 62385 62339 -46 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Added! |
@@ -958,7 +960,7 @@ func (qre *QueryExecutor) execRevertMigration() (*sqltypes.Result, error) { | |||
return qre.tsv.onlineDDLExecutor.SubmitMigration(qre.ctx, qre.plan.FullStmt) | |||
} | |||
|
|||
func (qre *QueryExecutor) execShowMigrations() (*sqltypes.Result, error) { | |||
func (qre *QueryExecutor) execShowMigrations(conn *StatefulConnection) (*sqltypes.Result, error) { |
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.
@shlomi-noach is conn *StatefulConnection
meant to be used here? I don't follow this part
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.
Yes-ish :). I'm not all too familiar with this either, but I got guidance from @harshit-gangal. The StatefulConnection
is the standard way for you to implement a transactional behavior working with QueryService. So we should pass that variable. Normally I'd also use the variable -- except:
- I don't really require
show vitess_migrations
to exhibit transactional behavior; it's ashow
command and I don;t need it to e.g. be repeatable-read or anything. I only need it to work from within a transaction. - Therefore no need to bloat the transaction.
- Also, the existing logic uses the executor's own connection pooling, which is fine, and there's no need/reason to now take apart the existing and working mechanism within the executor to accommodate the transactional connection.
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.
Ok sounds good 👍
…16399) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Description
See story in #16242
Related Issue(s)
Fixes #16242
Checklist
Deployment Notes