-
Notifications
You must be signed in to change notification settings - Fork 2.4k
VDiff: add --no-samples option to vdiff show #20870
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
bf09fd7
1aaebfd
8def81d
d3e709e
704c92d
4a06ba1
6614ddf
3fd87e6
1372373
eb16e19
b53afc3
fc1d8fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,11 +115,27 @@ func (vde *Engine) PerformVDiffAction(ctx context.Context, req *tabletmanagerdat | |
| return resp, nil | ||
| } | ||
|
|
||
| func (vde *Engine) getVDiffSummary(vdiffID int64, dbClient binlogplayer.DBClient) (*query.QueryResult, error) { | ||
| // vdiffSummaryQuery returns the summary query to run. When onlySummary is true | ||
| // it returns the variant that strips the row-sample arrays from the per-table | ||
| // report, keeping the scalar counters. The samples are the part that can grow | ||
| // very large (they carry sampled row data, including large blob/JSON columns) | ||
| // and, fanned out across many target shards, can push the aggregated response | ||
| // past gRPC message limits. Stripping them lets callers that only need the | ||
| // vdiff/table state, counts and has_mismatch avoid transferring that data while | ||
| // keeping the summary counters accurate. All other summary columns are | ||
| // unaffected. | ||
| func vdiffSummaryQuery(onlySummary bool) string { | ||
| if onlySummary { | ||
| return sqlVDiffSummaryOnly | ||
| } | ||
| return sqlVDiffSummary | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit, but summary feels very overloaded here to the point that it loses all meaning. Maybe we could at least call |
||
|
|
||
| func (vde *Engine) getVDiffSummary(vdiffID int64, dbClient binlogplayer.DBClient, reportOpts *tabletmanagerdatapb.VDiffReportOptions) (*query.QueryResult, error) { | ||
| var qr *sqltypes.Result | ||
| var err error | ||
|
|
||
| query, err := sqlparser.ParseAndBind(sqlVDiffSummary, sqltypes.Int64BindVariable(vdiffID), sqltypes.StringBindVariable(vde.dbName)) | ||
| query, err := sqlparser.ParseAndBind(vdiffSummaryQuery(reportOpts.GetOnlySummary()), sqltypes.Int64BindVariable(vdiffID), sqltypes.StringBindVariable(vde.dbName)) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
@@ -336,7 +352,7 @@ func (vde *Engine) handleShowAction(ctx context.Context, dbClient binlogplayer.D | |
| case 1: | ||
| row := qr.Named().Row() | ||
| vdiffID, _ := row["id"].ToInt64() | ||
| summary, err := vde.getVDiffSummary(vdiffID, dbClient) | ||
| summary, err := vde.getVDiffSummary(vdiffID, dbClient, req.GetOptions().GetReportOptions()) | ||
| resp.Output = summary | ||
| if err != nil { | ||
| return err | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.