From 22c510e258fe8632e5cae9ab6512a21213d5f7bd Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Tue, 19 Sep 2023 22:12:53 -0400 Subject: [PATCH] Moar tweaks Signed-off-by: Matt Lord --- .../command/vreplication/vdiff/vdiff.go | 2 +- go/flags/endtoend/vtctldclient.txt | 2 +- go/vt/vtctl/workflow/server.go | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/go/cmd/vtctldclient/command/vreplication/vdiff/vdiff.go b/go/cmd/vtctldclient/command/vreplication/vdiff/vdiff.go index 162fde8e57c..554d96b9874 100644 --- a/go/cmd/vtctldclient/command/vreplication/vdiff/vdiff.go +++ b/go/cmd/vtctldclient/command/vreplication/vdiff/vdiff.go @@ -117,7 +117,7 @@ var ( // base is the base command for all actions related to VDiff. base = &cobra.Command{ Use: "VDiff --workflow --keyspace [command] [command-flags]", - Short: "Perform commands related to diffing tables between the source keyspace and target keyspace.", + Short: "Perform commands related to diffing tables involved in a VReplication workflow between the source and target.", Long: `VDiff commands: create, resume, show, stop, and delete. See the --help output for each command for more details.`, DisableFlagsInUseLine: true, diff --git a/go/flags/endtoend/vtctldclient.txt b/go/flags/endtoend/vtctldclient.txt index f3570cd1f40..ea6503fbeb7 100644 --- a/go/flags/endtoend/vtctldclient.txt +++ b/go/flags/endtoend/vtctldclient.txt @@ -84,7 +84,7 @@ Available Commands: UpdateCellInfo Updates the content of a CellInfo with the provided parameters, creating the CellInfo if it does not exist. UpdateCellsAlias Updates the content of a CellsAlias with the provided parameters, creating the CellsAlias if it does not exist. UpdateThrottlerConfig Update the tablet throttler configuration for all tablets in the given keyspace (across all cells) - VDiff Perform commands related to diffing tables between the source keyspace and target keyspace. + VDiff Perform commands related to diffing tables involved in a VReplication workflow between the source and target. Validate Validates that all nodes reachable from the global replication graph, as well as all tablets in discoverable cells, are consistent. ValidateKeyspace Validates that all nodes reachable from the specified keyspace are consistent. ValidateSchemaKeyspace Validates that the schema on the primary tablet for shard 0 matches the schema on all other tablets in the keyspace. diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 9a82186d291..fb6227867d5 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -65,14 +65,14 @@ import ( vttimepb "vitess.io/vitess/go/vt/proto/vttime" ) -// TableCopyProgress stores the row counts and disk sizes of the source and target tables -type TableCopyProgress struct { +// tableCopyProgress stores the row counts and disk sizes of the source and target tables +type tableCopyProgress struct { TargetRowCount, TargetTableSize int64 SourceRowCount, SourceTableSize int64 } -// CopyProgress stores the TableCopyProgress for all tables still being copied -type CopyProgress map[string]*TableCopyProgress +// copyProgress stores the tableCopyProgress for all tables still being copied +type copyProgress map[string]*tableCopyProgress // sequenceMetadata contains all of the relevant metadata for a sequence that // is being used by a table involved in a vreplication workflow. @@ -1587,7 +1587,7 @@ func (s *Server) WorkflowStatus(ctx context.Context, req *vtctldatapb.WorkflowSt tables = append(tables, table) } sort.Strings(tables) - var progress TableCopyProgress + var progress tableCopyProgress for _, table := range tables { var rowCountPct, tableSizePct float32 resp.TableCopyState[table] = &vtctldatapb.WorkflowStatusResponse_TableCopyState{} @@ -1666,7 +1666,7 @@ func (s *Server) WorkflowStatus(ctx context.Context, req *vtctldatapb.WorkflowSt // GetCopyProgress returns the progress of all tables being copied in the // workflow. -func (s *Server) GetCopyProgress(ctx context.Context, ts *trafficSwitcher, state *State) (*CopyProgress, error) { +func (s *Server) GetCopyProgress(ctx context.Context, ts *trafficSwitcher, state *State) (*copyProgress, error) { getTablesQuery := "select distinct table_name from _vt.copy_state cs, _vt.vreplication vr where vr.id = cs.vrepl_id and vr.id = %d" getRowCountQuery := "select table_name, table_rows, data_length from information_schema.tables where table_schema = %s and table_name in (%s)" tables := make(map[string]bool) @@ -1783,9 +1783,9 @@ func (s *Server) GetCopyProgress(ctx context.Context, ts *trafficSwitcher, state } } - copyProgress := CopyProgress{} + copyProgress := copyProgress{} for table, rowCount := range targetRowCounts { - copyProgress[table] = &TableCopyProgress{ + copyProgress[table] = &tableCopyProgress{ TargetRowCount: rowCount, TargetTableSize: targetTableSizes[table], SourceRowCount: sourceRowCounts[table],