Commit bf09fd7
committed
feat(vdiff): add only_summary option to vdiff show
VDiff show returns a per-table diff report body (stored in
_vt.vdiff_table.report) alongside the summary state. The report's row-sample
arrays (MismatchedRowsSample, ExtraRowsSourceSample, ExtraRowsTargetSample)
carry actual sampled row data, including large blob/JSON columns, and vdiff
show aggregates them across every target shard. For diffs over tables with
large rows this can push the aggregated gRPC response past message-size limits
and make vdiff show fail outright, leaving callers that only need progress and
the has_mismatch flag with no way to read the summary.
Add an only_summary option, threaded from the vtctldclient `--only-summary`
flag through VDiffShowRequest and the tablet VDiffReportOptions. When set, the
tablet's summary query strips the row-sample arrays from the report via
JSON_REMOVE while preserving the scalar counters (ProcessedRows, MatchingRows,
MismatchedRows, ExtraRows*), so the summary counts stay accurate and the large
sampled rows are neither read into the response nor sent to vtctld.
JSON_REMOVE returns NULL when the report is NULL (no joined vdiff_table row),
matching the plain-column behavior. All other summary columns are unaffected.
The summary query is composed from shared column-list and FROM/WHERE constants
so the two variants differ only in the report select-expression.
## AI Disclosure
This change was co-authored with Claude Code, which helped with implementation
and testing.
Signed-off-by: Pedro Albuquerque <pedro.albuquerque@slack-corp.com>1 parent bd205ba commit bf09fd7
14 files changed
Lines changed: 282 additions & 15 deletions
File tree
- changelog/25.0/25.0.0
- go
- cmd/vtctldclient/command/vreplication/vdiff
- vt
- proto
- tabletmanagerdata
- vtctldata
- vtctl/workflow
- vttablet/tabletmanager/vdiff
- proto
- web/vtadmin/src/proto
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
173 | 184 | | |
174 | 185 | | |
175 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
645 | 646 | | |
646 | 647 | | |
647 | 648 | | |
| 649 | + | |
648 | 650 | | |
649 | 651 | | |
650 | 652 | | |
| |||
709 | 711 | | |
710 | 712 | | |
711 | 713 | | |
| 714 | + | |
712 | 715 | | |
713 | 716 | | |
714 | 717 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
569 | 574 | | |
570 | 575 | | |
571 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
119 | 135 | | |
120 | 136 | | |
121 | 137 | | |
122 | | - | |
| 138 | + | |
123 | 139 | | |
124 | 140 | | |
125 | 141 | | |
| |||
336 | 352 | | |
337 | 353 | | |
338 | 354 | | |
339 | | - | |
| 355 | + | |
340 | 356 | | |
341 | 357 | | |
342 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
37 | 79 | | |
38 | 80 | | |
39 | 81 | | |
| |||
0 commit comments