Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog/25.0/25.0.0/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- **[Minor Changes](#minor-changes)**
- **[VReplication](#minor-changes-vreplication)**
- [Default data protection for `_reverse` workflow cancel/complete](#vreplication-reverse-workflow-data-protection)
- [`vdiff show --no-samples` strips the per-table row-sample report](#vreplication-vdiff-no-samples)
- **[VTGate](#minor-changes-vtgate)**
- [Ingress bytes in query LogStats](#vtgate-logstats-ingress-bytes)
- [New controls for cross-keyspace reads](#vtgate-cross-keyspace-reads)
Expand Down Expand Up @@ -173,6 +174,14 @@ The `--keep-data` flag help text has been updated to note this default explicitl

See [#19906](https://github.com/vitessio/vitess/pull/19906) for details.

#### <a id="vreplication-vdiff-no-samples"/>`vdiff show --no-samples` strips the per-table row-sample report</a>

`vtctldclient vdiff ... show` now accepts a `--no-samples` flag. When set, the per-table diff report has its row-sample arrays (`MismatchedRowsSample`, `ExtraRowsSourceSample`, `ExtraRowsTargetSample`) stripped on the tablet, while the scalar counters and all other summary fields are preserved. This avoids exceeding gRPC message limits when `vdiff show` aggregates large blob/JSON row samples across every target shard. It is exposed as `no_samples` on the `VDiffShowRequest` (vtctld) and `VDiffReportOptions` (tablet) protobuf messages, and is opt-in and backward compatible.

`vdiff create --wait` also uses `no_samples` for its internal progress polls. Text output is unchanged; with `--format json`, the per-interval progress output no longer includes the row samples (they remain available via `vdiff show --verbose` once the diff completes).

See [#20870](https://github.com/vitessio/vitess/pull/20870) for details.
Comment thread
pedroalb marked this conversation as resolved.

### <a id="minor-changes-vtgate"/>VTGate</a>

#### <a id="vtgate-logstats-ingress-bytes"/>Ingress bytes in query LogStats</a>
Expand Down
8 changes: 6 additions & 2 deletions go/cmd/vtctldclient/command/vreplication/vdiff/vdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ var (
}{}

showOptions = struct {
Arg string
Verbose bool
Arg string
Verbose bool
NoSamples bool
}{}

stopOptions = struct {
Expand Down Expand Up @@ -322,6 +323,7 @@ func commandCreate(cmd *cobra.Command, args []string) error {
Workflow: common.BaseOptions.Workflow,
TargetKeyspace: common.BaseOptions.TargetKeyspace,
Arg: uuidStr,
NoSamples: true,
Comment thread
pedroalb marked this conversation as resolved.
})
if err != nil {
return err
Expand Down Expand Up @@ -645,6 +647,7 @@ func commandShow(cmd *cobra.Command, args []string) error {
Workflow: common.BaseOptions.Workflow,
TargetKeyspace: common.BaseOptions.TargetKeyspace,
Arg: showOptions.Arg,
NoSamples: showOptions.NoSamples,
})
if err != nil {
return err
Expand Down Expand Up @@ -709,6 +712,7 @@ func registerCommands(root *cobra.Command) {
base.AddCommand(resume)

show.Flags().BoolVar(&showOptions.Verbose, "verbose", false, "Show verbose output in summaries")
show.Flags().BoolVar(&showOptions.NoSamples, "no-samples", false, "Strip the per-table diff report's row-sample arrays (keeping the scalar counters). Useful for large diffs where the samples can exceed gRPC message limits.")
Comment thread
pedroalb marked this conversation as resolved.
Comment thread
pedroalb marked this conversation as resolved.
Comment thread
pedroalb marked this conversation as resolved.
base.AddCommand(show)

stop.Flags().StringSliceVar(&stopOptions.TargetShards, "target-shards", nil, "The target shards to stop the vdiff on; default is all shards.")
Expand Down
18 changes: 18 additions & 0 deletions go/cmd/vtctldclient/command/vreplication/vdiff/vdiff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"time"

"github.com/google/uuid"
"github.com/spf13/cobra"
"github.com/stretchr/testify/require"

"vitess.io/vitess/go/sqltypes"
Expand Down Expand Up @@ -813,3 +814,20 @@ func TestGetStructNames(t *testing.T) {
want := []string{"A", "B"}
require.Equal(t, want, got)
}

// TestShowNoSamplesFlag guards the `vdiff show --no-samples` flag against
// accidental removal or renaming. The go/flags/endtoend golden fixtures only
// cover each binary's root --help, not subcommands, so this is the flag's
// regression coverage (mirrors the movetables keep-data flag test).
Comment thread
pedroalb marked this conversation as resolved.
Outdated
func TestShowNoSamplesFlag(t *testing.T) {
root := &cobra.Command{Use: "test"}
registerCommands(root)

showCmd, _, err := root.Find([]string{"VDiff", "show"})
require.NoError(t, err)

flag := showCmd.Flags().Lookup("no-samples")
require.NotNil(t, flag, "vdiff show must expose the --no-samples flag")
require.Equal(t, "false", flag.DefValue, "--no-samples must default to false")
require.Contains(t, flag.Usage, "gRPC message limits")
}
21 changes: 17 additions & 4 deletions go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions go/vt/proto/vtctldata/vtctldata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions go/vt/proto/vtctldata/vtctldata_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions go/vt/vtctl/workflow/vdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,11 @@ func (s *Server) VDiffShow(ctx context.Context, req *vtctldatapb.VDiffShowReques
Workflow: req.Workflow,
Action: string(vdiff.ShowAction),
ActionArg: req.Arg,
Options: &tabletmanagerdatapb.VDiffOptions{
ReportOptions: &tabletmanagerdatapb.VDiffReportOptions{
NoSamples: req.GetNoSamples(),
},
},
}

ts, err := s.buildTrafficSwitcher(ctx, req.TargetKeyspace, req.Workflow)
Expand Down
Loading
Loading