Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions doc/releasenotes/15_0_0_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ The following VTTablet flags were deprecated in 7.0. They have now been deleted
#### vttablet startup flag deprecations
- --enable-query-plan-field-caching is now deprecated. It will be removed in v16.
- --enable_semi_sync is now deprecated. It will be removed in v16. Instead, set the correct durability policy using `SetKeyspaceDurabilityPolicy`
- --queryserver-config-pool-prefill-parallelism, --queryserver-config-stream-pool-prefill-parallelism and --queryserver-config-transaction-prefill-parallelism have all been deprecated. They will be removed in v16.

### New command line flags and behavior

Expand Down
10 changes: 2 additions & 8 deletions go/cmd/vtctlclient/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,15 @@ func init() {
// VEP-4 will replace the need for this function. See https://github.com/vitessio/enhancements/blob/main/veps/vep-4.md
func checkDeprecations(args []string) {
// utility:
findSubstring := func(s string) (arg string, ok bool) {
// name this to findSubstring if you need to use it
_ = func(s string) (arg string, ok bool) {
for _, arg := range args {
if strings.Contains(arg, s) {
return arg, true
}
}
return "", false
}
if _, ok := findSubstring("ApplySchema"); ok {
if arg, ok := findSubstring("ddl_strategy"); ok {
if strings.Contains(arg, "-skip-topo") {
log.Warning("-skip-topo is deprecated and will be removed in future versions")
}
}
}
}

func main() {
Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/recovery/pitr/shardedpitr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ func performResharding(t *testing.T) {
err = clusterInstance.VtctlclientProcess.ExecuteCommand("Reshard", "--", "--v1", "ks.reshardWorkflow", "0", "-80,80-")
require.NoError(t, err)

err = clusterInstance.VtctlclientProcess.ExecuteCommand("SwitchReads", "--", "--tablet_type=rdonly", "ks.reshardWorkflow")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("SwitchReads", "--", "--tablet_types=rdonly", "ks.reshardWorkflow")
require.NoError(t, err)

err = clusterInstance.VtctlclientProcess.ExecuteCommand("SwitchReads", "--", "--tablet_type=replica", "ks.reshardWorkflow")
err = clusterInstance.VtctlclientProcess.ExecuteCommand("SwitchReads", "--", "--tablet_types=replica", "ks.reshardWorkflow")
require.NoError(t, err)

// then serve primary from the split shards
Expand Down
6 changes: 3 additions & 3 deletions go/test/endtoend/vreplication/vreplication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1191,17 +1191,17 @@ func applyVSchema(t *testing.T, vschema, keyspace string) {
}

func switchReadsDryRun(t *testing.T, cells, ksWorkflow string, dryRunResults []string) {
output, err := vc.VtctlClient.ExecuteCommandWithOutput("SwitchReads", "--", "--cells="+cells, "--tablet_type=replica", "--dry_run", ksWorkflow)
output, err := vc.VtctlClient.ExecuteCommandWithOutput("SwitchReads", "--", "--cells="+cells, "--tablet_types=replica", "--dry_run", ksWorkflow)
require.NoError(t, err, fmt.Sprintf("SwitchReads DryRun Error: %s: %s", err, output))
validateDryRunResults(t, output, dryRunResults)
}

func switchReads(t *testing.T, cells, ksWorkflow string) {
var output string
var err error
output, err = vc.VtctlClient.ExecuteCommandWithOutput("SwitchReads", "--", "--cells="+cells, "--tablet_type=rdonly", ksWorkflow)
output, err = vc.VtctlClient.ExecuteCommandWithOutput("SwitchReads", "--", "--cells="+cells, "--tablet_types=rdonly", ksWorkflow)
require.NoError(t, err, fmt.Sprintf("SwitchReads Error: %s: %s", err, output))
output, err = vc.VtctlClient.ExecuteCommandWithOutput("SwitchReads", "--", "--cells="+cells, "--tablet_type=replica", ksWorkflow)
output, err = vc.VtctlClient.ExecuteCommandWithOutput("SwitchReads", "--", "--cells="+cells, "--tablet_types=replica", ksWorkflow)
require.NoError(t, err, fmt.Sprintf("SwitchReads Error: %s: %s", err, output))
}

Expand Down
5 changes: 0 additions & 5 deletions go/vt/topo/stats_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,10 @@ func (st *StatsConn) WatchRecursive(ctx context.Context, path string) ([]*WatchD
// NewLeaderParticipation is part of the Conn interface
func (st *StatsConn) NewLeaderParticipation(name, id string) (LeaderParticipation, error) {
startTime := time.Now()
// TODO(deepthi): delete after v13.0
deprecatedKey := []string{"NewMasterParticipation", st.cell}
defer topoStatsConnTimings.Record(deprecatedKey, startTime)

statsKey := []string{"NewLeaderParticipation", st.cell}
defer topoStatsConnTimings.Record(statsKey, startTime)
res, err := st.conn.NewLeaderParticipation(name, id)
if err != nil {
topoStatsConnErrors.Add(deprecatedKey, int64(1))
topoStatsConnErrors.Add(statsKey, int64(1))
return res, err
}
Expand Down
20 changes: 2 additions & 18 deletions go/vt/topo/stats_conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,35 +319,19 @@ func TestStatsConnTopoNewLeaderParticipation(t *testing.T) {
statsConn := NewStatsConn("global", conn)

_, _ = statsConn.NewLeaderParticipation("", "")
// TODO(deepthi): delete "Master" stats after v13.0
timingCounts := topoStatsConnTimings.Counts()["NewMasterParticipation.global"]
if got, want := timingCounts, int64(1); got != want {
t.Errorf("stats were not properly recorded: got = %d, want = %d", got, want)
}
timingCounts = topoStatsConnTimings.Counts()["NewLeaderParticipation.global"]
timingCounts := topoStatsConnTimings.Counts()["NewLeaderParticipation.global"]
if got, want := timingCounts, int64(1); got != want {
t.Errorf("stats were not properly recorded: got = %d, want = %d", got, want)
}

// error is zero before getting an error
errorCount := topoStatsConnErrors.Counts()["NewMasterParticipation.global"]
if got, want := errorCount, int64(0); got != want {
t.Errorf("stats were not properly recorded: got = %d, want = %d", got, want)
}
// error is zero before getting an error
errorCount = topoStatsConnErrors.Counts()["NewLeaderParticipation.global"]
errorCount := topoStatsConnErrors.Counts()["NewLeaderParticipation.global"]
if got, want := errorCount, int64(0); got != want {
t.Errorf("stats were not properly recorded: got = %d, want = %d", got, want)
}

_, _ = statsConn.NewLeaderParticipation("error", "")

// error stats gets emitted
errorCount = topoStatsConnErrors.Counts()["NewMasterParticipation.global"]
if got, want := errorCount, int64(1); got != want {
t.Errorf("stats were not properly recorded: got = %d, want = %d", got, want)
}

// error stats gets emitted
errorCount = topoStatsConnErrors.Counts()["NewLeaderParticipation.global"]
if got, want := errorCount, int64(1); got != want {
Expand Down
37 changes: 3 additions & 34 deletions go/vt/vtctl/vtctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,6 @@ var commands = []commandGroup{
params: "<tablet alias>",
help: "Runs a health check on a remote tablet.",
},
{
name: "IgnoreHealthError",
method: commandIgnoreHealthError,
params: "<tablet alias> <ignore regexp>",
help: "Sets the regexp for health check errors to ignore on the specified tablet. The pattern has implicit ^$ anchors. Set to empty string or restart vttablet to stop ignoring anything.",
deprecated: true,
},
{
name: "Sleep",
method: commandSleep,
Expand Down Expand Up @@ -464,7 +457,7 @@ var commands = []commandGroup{
{
name: "CreateLookupVindex",
method: commandCreateLookupVindex,
params: "[--cell=<source_cells> DEPRECATED] [--cells=<source_cells>] [--tablet_types=<source_tablet_types>] <keyspace> <json_spec>",
params: "[--cells=<source_cells>] [--tablet_types=<source_tablet_types>] <keyspace> <json_spec>",
help: `Create and backfill a lookup vindex. the json_spec must contain the vindex and colvindex specs for the new lookup.`,
},
{
Expand All @@ -488,7 +481,7 @@ var commands = []commandGroup{
{
name: "SwitchReads",
method: commandSwitchReads,
params: "[--cells=c1,c2,...] [--reverse] --tablet_type={replica|rdonly} [--dry_run] <keyspace.workflow>",
params: "[--cells=c1,c2,...] [--reverse] [--tablet_types=REPLICA,RDONLY] [--dry_run] <keyspace.workflow>",
help: "Switch read traffic for the specified workflow.",
},
{
Expand Down Expand Up @@ -1259,10 +1252,6 @@ func commandRunHealthCheck(ctx context.Context, wr *wrangler.Wrangler, subFlags
return err
}

func commandIgnoreHealthError(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error {
return fmt.Errorf("this command is no longer relevant and has been deprecated")
}

func commandSleep(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error {
if err := subFlags.Parse(args); err != nil {
return err
Expand Down Expand Up @@ -2527,8 +2516,6 @@ func commandVRWorkflow(ctx context.Context, wr *wrangler.Wrangler, subFlags *fla

func commandCreateLookupVindex(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error {
cells := subFlags.String("cells", "", "Source cells to replicate from.")
// TODO: keep --cell around for backward compatibility and remove it in a future version
cell := subFlags.String("cell", "", "Cell to replicate from.")
tabletTypes := subFlags.String("tablet_types", "", "Source tablet types to replicate from.")
continueAfterCopyWithOwner := subFlags.Bool("continue_after_copy_with_owner", false, "Vindex will continue materialization after copy when an owner is provided")
if err := subFlags.Parse(args); err != nil {
Expand All @@ -2537,9 +2524,6 @@ func commandCreateLookupVindex(ctx context.Context, wr *wrangler.Wrangler, subFl
if subFlags.NArg() != 2 {
return fmt.Errorf("two arguments are required: keyspace and json_spec")
}
if *cells == "" && *cell != "" {
*cells = *cell
}
keyspace := subFlags.Arg(0)
specs := &vschemapb.Keyspace{}
if err := json2.Unmarshal([]byte(subFlags.Arg(1)), specs); err != nil {
Expand Down Expand Up @@ -2681,21 +2665,12 @@ func commandSwitchReads(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl

reverse := subFlags.Bool("reverse", false, "Moves the served tablet type backward instead of forward.")
cellsStr := subFlags.String("cells", "", "Specifies a comma-separated list of cells to update")
tabletTypes := subFlags.String("tablet_types", "rdonly,replica", "Tablet types to switch one or both or rdonly/replica")
deprecatedTabletType := subFlags.String("tablet_type", "", "(DEPRECATED) one of rdonly/replica")
tabletTypes := subFlags.String("tablet_types", "rdonly,replica", "Tablet types to switch one or both of rdonly/replica")
dryRun := subFlags.Bool("dry_run", false, "Does a dry run of SwitchReads and only reports the actions to be taken")
if err := subFlags.Parse(args); err != nil {
return err
}

if !(*deprecatedTabletType == "" || *deprecatedTabletType == "replica" || *deprecatedTabletType == "rdonly") {
return fmt.Errorf("invalid value specified for --tablet_type: %s", *deprecatedTabletType)
}

if *deprecatedTabletType != "" {
*tabletTypes = *deprecatedTabletType
}

tabletTypesArr := strings.Split(*tabletTypes, ",")
var servedTypes []topodatapb.TabletType
for _, tabletType := range tabletTypesArr {
Expand Down Expand Up @@ -3081,12 +3056,6 @@ func commandApplySchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl
return fmt.Errorf("the <keyspace> argument is required for the commandApplySchema command")
}

// v14 deprecates `--skip-topo` flag. This check will be removed in v15
if settings, _ := schema.ParseDDLStrategy(*ddlStrategy); settings != nil && settings.IsSkipTopoFlag() {
deprecationMessage := `--skip-topo flag is deprecated and will be removed in v15`
log.Warningf(deprecationMessage)
}

keyspace := subFlags.Arg(0)
change, err := getFileParam(*sql, *sqlFile, "sql")
if err != nil {
Expand Down