Skip to content

Commit

Permalink
Moar tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Sep 20, 2023
1 parent dd37e1a commit 22c510e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go/cmd/vtctldclient/command/vreplication/vdiff/vdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ var (
// base is the base command for all actions related to VDiff.
base = &cobra.Command{
Use: "VDiff --workflow <workflow> --keyspace <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,
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtctldclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 8 additions & 8 deletions go/vt/vtctl/workflow/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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{}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 22c510e

Please sign in to comment.