Skip to content

Commit

Permalink
Remove Deprecated flags, code and stats. (#12083)
Browse files Browse the repository at this point in the history
* feat: remove deprecated fields in logstats

Signed-off-by: Manan Gupta <[email protected]>

* feat: remove enable_semi_sync

Signed-off-by: Manan Gupta <[email protected]>

* feat: remove QueryRowCounts stat

Signed-off-by: Manan Gupta <[email protected]>

* feat: remove deprecated and unused field

Signed-off-by: Manan Gupta <[email protected]>

* feat: remove unused code

Signed-off-by: Manan Gupta <[email protected]>

* release-notes: fix review comments in release-notes

Signed-off-by: Manan Gupta <[email protected]>

* test: remove enable_semi_sync flag from the tests

Signed-off-by: Manan Gupta <[email protected]>

* feat: remove tests for QueryRowCounts

Signed-off-by: Manan Gupta <[email protected]>

* feat: deprecate QueriesProcessed and QueriesRouted

Signed-off-by: Manan Gupta <[email protected]>

* docs: make versions consistant in the release summary

Signed-off-by: Manan Gupta <[email protected]>

Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 authored Jan 20, 2023
1 parent bc94876 commit 2d6c719
Show file tree
Hide file tree
Showing 37 changed files with 51 additions and 164 deletions.
20 changes: 19 additions & 1 deletion doc/releasenotes/16_0_0_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,24 @@ If you have code searching for error strings from Vitess, this is a breaking cha
Many error strings have been tweaked.
If your application is searching for specific errors, you might need to update your code.

#### Logstats Table and Keyspace removed

Information about which tables are used is now reported by the field TablesUsed added in v15, that is a string array, listing all tables and which keyspace they are in.
The Table/Keyspace fields were deprecated in v15 and are now removed in the v16 release of Vitess.

#### Removed Stats

The stat `QueryRowCounts` is removed in v16. `QueryRowsAffected` and `QueryRowsReturned` can be used instead to gather the same information.

#### Deprecated Stats

The stats `QueriesProcessed` and `QueriesRouted` are deprecated in v16. The same information can be inferred from the stats `QueriesProcessedByTable` and `QueriesRoutedByTable` respectively. These stats will be removed in the next release.

#### Removed flag

The following flag is removed in v16:
- `enable_semi_sync`

#### <a id="lock-timeout-introduction"/> `lock-timeout` and `remote_operation_timeout` Changes

Earlier, the shard and keyspace locks used to be capped by the `remote_operation_timeout`. This is no longer the case and instead a new flag called `lock-timeout` is introduced.
Expand Down Expand Up @@ -215,7 +233,7 @@ is now fixed. The full issue can be found [here](https://github.com/vitessio/vit

### Deprecations and Removals

- The V3 planner is deprecated as of the V16 release, and will be removed in the V17 release of Vitess.
- The V3 planner is deprecated as of the v16 release, and will be removed in the v17 release of Vitess.

- The [VReplication v1 commands](https://vitess.io/docs/15.0/reference/vreplication/v1/) — which were deprecated in Vitess 11.0 — have been removed. You will need to use the [VReplication v2 commands](https://vitess.io/docs/16.0/reference/vreplication/v2/) instead.

Expand Down
1 change: 0 additions & 1 deletion docker/mini/vttablet-mini-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ vttablet \
-init_shard $shard \
-init_tablet_type $tablet_type \
-health_check_interval 5s \
-enable_semi_sync \
-enable_replication_reporter \
-backup_storage_implementation file \
-file_backup_storage_root $VTDATAROOT/backups \
Expand Down
42 changes: 0 additions & 42 deletions go/internal/flag/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import (
"strings"

flag "github.com/spf13/pflag"

"vitess.io/vitess/go/vt/log"
)

// Parse wraps the standard library's flag.Parse to perform some sanity checking
Expand Down Expand Up @@ -245,46 +243,6 @@ func Arg(i int) string {
return ""
}

const (
singleDashLongFlagsWarning = "Use of single-dash long flags is deprecated and will be removed in the next version of Vitess. Please use --%s instead"
mixedFlagsAndPosargsWarning = "Detected a dashed argument after a positional argument. " +
"Currently these are treated as posargs that may be parsed by a subcommand, but in the next version of Vitess they will be parsed as top-level flags, which may not be defined, causing errors. " +
"To preserve existing behavior, please update your invocation to include a \"--\" after all top-level flags to continue treating %s as a positional argument."
)

// Check and warn on any single-dash flags.
// nolint:deadcode
func warnOnSingleDashLongFlags(fs *goflag.FlagSet, argv []string, warningf func(msg string, args ...any)) {
fs.Visit(func(f *goflag.Flag) {
// Boolean flags with single-character names are okay to use the
// single-dash form. I don't _think_ we have any of these, but I'm being
// conservative here.
if bf, ok := f.Value.(maybeBoolFlag); ok && bf.IsBoolFlag() && len(f.Name) == 1 {
return
}

for _, arg := range argv {
if strings.HasPrefix(arg, "-"+f.Name) {
warningf(singleDashLongFlagsWarning, f.Name)
}
}
})
}

// Check and warn for any mixed posarg / dashed-arg on the CLI.
// nolint:deadcode
func warnOnMixedPositionalAndFlagArguments(posargs []string, warningf func(msg string, args ...any)) {
for _, arg := range posargs {
if arg == "--" {
break
}

if strings.HasPrefix(arg, "-") {
log.Warningf(mixedFlagsAndPosargsWarning, arg)
}
}
}

// From the standard library documentation:
//
// > If a Value has an IsBoolFlag() bool method returning true, the
Expand Down
4 changes: 0 additions & 4 deletions go/mysql/conn_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ type ConnParams struct {
ServerName string `json:"server_name"`
ConnectTimeoutMs uint64 `json:"connect_timeout_ms"`

// The following is only set when the deprecated "dbname" flags are
// supplied and will be removed.
DeprecatedDBName string

// The following is only set to force the client to connect without
// using CapabilityClientDeprecateEOF
DisableClientDeprecateEOF bool
Expand Down
1 change: 0 additions & 1 deletion go/test/endtoend/backup/vtbackup/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ func TestMain(m *testing.M) {
tablet.VttabletProcess.DbPassword = dbPassword
tablet.VttabletProcess.ExtraArgs = commonTabletArg
tablet.VttabletProcess.SupportsBackup = true
tablet.VttabletProcess.EnableSemiSync = true

tablet.MysqlctlProcess = *cluster.MysqlCtlProcessInstance(tablet.TabletUID, tablet.MySQLPort, localCluster.TmpDirectory)
tablet.MysqlctlProcess.InitDBFile = newInitDBFile
Expand Down
11 changes: 6 additions & 5 deletions go/test/endtoend/cellalias/cell_alias_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ func TestMain(m *testing.M) {
return 1, err
}

vtctldClientProcess := cluster.VtctldClientProcessInstance("localhost", localCluster.VtctldProcess.GrpcPort, localCluster.TmpDirectory)
_, err = vtctldClientProcess.ExecuteCommandWithOutput("CreateKeyspace", keyspaceName, "--durability-policy=semi_sync")
if err != nil {
return 1, err
}

shard1Primary = localCluster.NewVttabletInstance("primary", 0, cell1)
shard1Replica = localCluster.NewVttabletInstance("replica", 0, cell2)
shard1Rdonly = localCluster.NewVttabletInstance("rdonly", 0, cell2)
Expand All @@ -139,7 +145,6 @@ func TestMain(m *testing.M) {
hostname,
localCluster.TmpDirectory,
commonTabletArg,
true,
localCluster.DefaultCharset,
)
tablet.VttabletProcess.SupportsBackup = true
Expand All @@ -155,10 +160,6 @@ func TestMain(m *testing.M) {
}
}

if err := localCluster.VtctlProcess.CreateKeyspace(keyspaceName); err != nil {
return 1, err
}

shard1 := cluster.Shard{
Name: "-80",
Vttablets: []*cluster.Vttablet{shard1Primary, shard1Replica, shard1Rdonly},
Expand Down
7 changes: 0 additions & 7 deletions go/test/endtoend/cluster/cluster_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ type LocalProcessCluster struct {

VtctldExtraArgs []string

EnableSemiSync bool

// mutex added to handle the parallel teardowns
mx *sync.Mutex
teardownCompleted bool
Expand Down Expand Up @@ -359,7 +357,6 @@ func (cluster *LocalProcessCluster) startKeyspace(keyspace Keyspace, shardNames
cluster.Hostname,
cluster.TmpDirectory,
cluster.VtTabletExtraArgs,
cluster.EnableSemiSync,
cluster.DefaultCharset)
tablet.Alias = tablet.VttabletProcess.TabletPath
if cluster.ReusingVTDATAROOT {
Expand Down Expand Up @@ -500,7 +497,6 @@ func (cluster *LocalProcessCluster) StartKeyspaceLegacy(keyspace Keyspace, shard
cluster.Hostname,
cluster.TmpDirectory,
cluster.VtTabletExtraArgs,
cluster.EnableSemiSync,
cluster.DefaultCharset)
tablet.Alias = tablet.VttabletProcess.TabletPath
if cluster.ReusingVTDATAROOT {
Expand Down Expand Up @@ -614,7 +610,6 @@ func (cluster *LocalProcessCluster) SetupCluster(keyspace *Keyspace, shards []Sh
cluster.Hostname,
cluster.TmpDirectory,
cluster.VtTabletExtraArgs,
cluster.EnableSemiSync,
cluster.DefaultCharset)
}

Expand Down Expand Up @@ -1168,7 +1163,6 @@ func (cluster *LocalProcessCluster) VtprocessInstanceFromVttablet(tablet *Vttabl
cluster.Hostname,
cluster.TmpDirectory,
cluster.VtTabletExtraArgs,
cluster.EnableSemiSync,
cluster.DefaultCharset)
}

Expand All @@ -1188,7 +1182,6 @@ func (cluster *LocalProcessCluster) StartVttablet(tablet *Vttablet, servingStatu
hostname,
cluster.TmpDirectory,
cluster.VtTabletExtraArgs,
cluster.EnableSemiSync,
cluster.DefaultCharset)

tablet.VttabletProcess.SupportsBackup = supportBackup
Expand Down
7 changes: 1 addition & 6 deletions go/test/endtoend/cluster/vttablet_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ type VttabletProcess struct {
VerifyURL string
QueryzURL string
StatusDetailsURL string
EnableSemiSync bool
SupportsBackup bool
ServingStatus string
DbPassword string
Expand Down Expand Up @@ -120,9 +119,6 @@ func (vttablet *VttabletProcess) Setup() (err error) {
if vttablet.SupportsBackup {
vttablet.proc.Args = append(vttablet.proc.Args, "--restore_from_backup")
}
if vttablet.EnableSemiSync {
vttablet.proc.Args = append(vttablet.proc.Args, "--enable_semi_sync")
}
if vttablet.DbFlavor != "" {
vttablet.proc.Args = append(vttablet.proc.Args, fmt.Sprintf("--db_flavor=%s", vttablet.DbFlavor))
}
Expand Down Expand Up @@ -593,7 +589,7 @@ func (vttablet *VttabletProcess) IsShutdown() bool {
// VttabletProcessInstance returns a VttabletProcess handle for vttablet process
// configured with the given Config.
// The process must be manually started by calling setup()
func VttabletProcessInstance(port, grpcPort, tabletUID int, cell, shard, keyspace string, vtctldPort int, tabletType string, topoPort int, hostname, tmpDirectory string, extraArgs []string, enableSemiSync bool, charset string) *VttabletProcess {
func VttabletProcessInstance(port, grpcPort, tabletUID int, cell, shard, keyspace string, vtctldPort int, tabletType string, topoPort int, hostname, tmpDirectory string, extraArgs []string, charset string) *VttabletProcess {
vtctl := VtctlProcessInstance(topoPort, hostname)
vttablet := &VttabletProcess{
Name: "vttablet",
Expand All @@ -613,7 +609,6 @@ func VttabletProcessInstance(port, grpcPort, tabletUID int, cell, shard, keyspac
GrpcPort: grpcPort,
VtctldAddress: fmt.Sprintf("http://%s:%d", hostname, vtctldPort),
ExtraArgs: extraArgs,
EnableSemiSync: enableSemiSync,
SupportsBackup: true,
ServingStatus: "NOT_SERVING",
BackupStorageImplementation: "file",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ func initializeCluster(t *testing.T) (int, error) {
clusterInstance.Hostname,
clusterInstance.TmpDirectory,
clusterInstance.VtTabletExtraArgs,
clusterInstance.EnableSemiSync,
clusterInstance.DefaultCharset)
tablet.Alias = tablet.VttabletProcess.TabletPath
shard.Vttablets = append(shard.Vttablets, tablet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ func clusterSetUp(t *testing.T) (int, error) {
clusterInstance.Hostname,
clusterInstance.TmpDirectory,
clusterInstance.VtTabletExtraArgs,
clusterInstance.EnableSemiSync,
clusterInstance.DefaultCharset)
tablet.Alias = tablet.VttabletProcess.TabletPath
shard.Vttablets = append(shard.Vttablets, tablet)
Expand Down
1 change: 0 additions & 1 deletion go/test/endtoend/mysqlctl/mysqlctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func initCluster(shardNames []string, totalTabletsRequired int) {
clusterInstance.Hostname,
clusterInstance.TmpDirectory,
clusterInstance.VtTabletExtraArgs,
clusterInstance.EnableSemiSync,
clusterInstance.DefaultCharset)
tablet.Alias = tablet.VttabletProcess.TabletPath

Expand Down
1 change: 0 additions & 1 deletion go/test/endtoend/mysqlctld/mysqlctld_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ func initCluster(shardNames []string, totalTabletsRequired int) error {
clusterInstance.Hostname,
clusterInstance.TmpDirectory,
clusterInstance.VtTabletExtraArgs,
clusterInstance.EnableSemiSync,
clusterInstance.DefaultCharset)
tablet.Alias = tablet.VttabletProcess.TabletPath

Expand Down
1 change: 0 additions & 1 deletion go/test/endtoend/recovery/pitr/shardedpitr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ func launchRecoveryTablet(t *testing.T, tablet *cluster.Vttablet, binlogServer *
clusterInstance.Hostname,
clusterInstance.TmpDirectory,
clusterInstance.VtTabletExtraArgs,
clusterInstance.EnableSemiSync,
clusterInstance.DefaultCharset)
tablet.Alias = tablet.VttabletProcess.TabletPath
tablet.VttabletProcess.SupportsBackup = true
Expand Down
1 change: 0 additions & 1 deletion go/test/endtoend/reparent/emergencyreparent/ers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ func TestERSForInitialization(t *testing.T) {
shard.Vttablets = tablets
clusterInstance.VtTabletExtraArgs = []string{
"--lock_tables_timeout", "5s",
"--enable_semi_sync",
"--init_populate_metadata",
"--track_schema_versions=true",
}
Expand Down
5 changes: 0 additions & 5 deletions go/test/endtoend/reparent/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ func setupCluster(ctx context.Context, t *testing.T, shardName string, cells []s
clusterInstance := cluster.NewCluster(cells[0], Hostname)
keyspace := &cluster.Keyspace{Name: KeyspaceName}

if durability == "semi_sync" {
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--enable_semi_sync")
}

// Start topo server
err := clusterInstance.StartTopo()
require.NoError(t, err, "Error starting topo")
Expand Down Expand Up @@ -218,7 +214,6 @@ func StartNewVTTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster
"--track_schema_versions=true",
"--queryserver_enable_online_ddl=false",
},
clusterInstance.EnableSemiSync,
clusterInstance.DefaultCharset)
tablet.VttabletProcess.SupportsBackup = supportsBackup

Expand Down
1 change: 0 additions & 1 deletion go/test/endtoend/sharded/sharded_keyspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ func initCluster(shardNames []string, totalTabletsRequired int) {
clusterInstance.Hostname,
clusterInstance.TmpDirectory,
clusterInstance.VtTabletExtraArgs,
clusterInstance.EnableSemiSync,
clusterInstance.DefaultCharset)
tablet.Alias = tablet.VttabletProcess.TabletPath

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ import (
)

const (
demoteQuery = "SET GLOBAL read_only = ON;FLUSH TABLES WITH READ LOCK;UNLOCK TABLES;"
disableSemiSyncSourceQuery = "SET GLOBAL rpl_semi_sync_master_enabled = 0"
enableSemiSyncSourceQuery = "SET GLOBAL rpl_semi_sync_master_enabled = 1"
promoteQuery = "STOP SLAVE;RESET SLAVE ALL;SET GLOBAL read_only = OFF;"
demoteQuery = "SET GLOBAL read_only = ON;FLUSH TABLES WITH READ LOCK;UNLOCK TABLES;"
promoteQuery = "STOP SLAVE;RESET SLAVE ALL;SET GLOBAL read_only = OFF;"

hostname = "localhost"
)
Expand All @@ -51,9 +49,6 @@ func failoverExternalReparenting(t *testing.T, clusterInstance *cluster.LocalPro
oldPrimary := primary
newPrimary := replica
primary.VttabletProcess.QueryTablet(demoteQuery, keyspaceUnshardedName, true)
if primary.VttabletProcess.EnableSemiSync {
primary.VttabletProcess.QueryTablet(disableSemiSyncSourceQuery, keyspaceUnshardedName, true)
}

// Wait for replica to catch up to primary.
cluster.WaitForReplicationPos(t, primary, replica, "localhost", 60.0)
Expand All @@ -69,10 +64,6 @@ func failoverExternalReparenting(t *testing.T, clusterInstance *cluster.LocalPro
// Promote replica to new primary.
replica.VttabletProcess.QueryTablet(promoteQuery, keyspaceUnshardedName, true)

if replica.VttabletProcess.EnableSemiSync {
replica.VttabletProcess.QueryTablet(enableSemiSyncSourceQuery, keyspaceUnshardedName, true)
}

// Configure old primary to replicate from new primary.

_, gtID := cluster.GetPrimaryPosition(t, *newPrimary, hostname)
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/tabletmanager/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ func TestMain(m *testing.M) {
"--health_check_interval", tabletHealthcheckRefreshInterval.String(),
"--unhealthy_threshold", tabletUnhealthyThreshold.String(),
}
// We do not need semiSync for this test case.
clusterInstance.EnableSemiSync = false

// Start keyspace
keyspace := &cluster.Keyspace{
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/tabletmanager/primary/tablet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ func TestMain(m *testing.M) {
"--watch_replication_stream",
"--enable_replication_reporter",
}
// We do not need semiSync for this test case.
clusterInstance.EnableSemiSync = false

// Start keyspace
keyspace := &cluster.Keyspace{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ func TestMain(m *testing.M) {
return 1
}

// We do not need semiSync for this test case.
clusterInstance.EnableSemiSync = false

// Start keyspace
keyspace := &cluster.Keyspace{
Name: keyspaceName,
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/tabletmanager/tablegc/tablegc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ func TestMain(m *testing.M) {
"--gc_purge_check_interval", gcPurgeCheckInterval.String(),
"--table_gc_lifecycle", "hold,purge,evac,drop",
}
// We do not need semiSync for this test case.
clusterInstance.EnableSemiSync = false

// Start keyspace
keyspace := &cluster.Keyspace{
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/tabletmanager/throttler/throttler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ func TestMain(m *testing.M) {
"--heartbeat_on_demand_duration", onDemandHeartbeatDuration.String(),
"--disable_active_reparents",
}
// We do not need semiSync for this test case.
clusterInstance.EnableSemiSync = false

// Start keyspace
keyspace := &cluster.Keyspace{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ func TestMain(m *testing.M) {
"--heartbeat_enable",
"--heartbeat_interval", "250ms",
}
// We do not need semiSync for this test case.
clusterInstance.EnableSemiSync = false

// Start keyspace
keyspace := &cluster.Keyspace{
Expand Down
Loading

0 comments on commit 2d6c719

Please sign in to comment.