Skip to content

Commit

Permalink
remove deprecated flags
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Sep 21, 2023
1 parent 6397944 commit 7eb6c68
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 126 deletions.
2 changes: 0 additions & 2 deletions go/cmd/vtcombo/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import (
"vitess.io/vitess/go/vt/servenv"
"vitess.io/vitess/go/vt/srvtopo"
"vitess.io/vitess/go/vt/vtgate"

_ "vitess.io/vitess/go/vt/status"
)

func addStatusParts(vtg *vtgate.VTGate) {
Expand Down
2 changes: 0 additions & 2 deletions go/cmd/vtctldclient/command/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,6 @@ func commandReloadSchemaShard(cmd *cobra.Command, args []string) error {
func init() {
ApplySchema.Flags().Bool("allow-long-unavailability", false, "Deprecated and has no effect.")
ApplySchema.Flags().MarkDeprecated("--allow-long-unavailability", "")
ApplySchema.Flags().Bool("skip-preflight", false, "Deprecated and has no effect.")
ApplySchema.Flags().MarkDeprecated("--skip-preflight", "Deprecated. Assumed to be always 'true'")
ApplySchema.Flags().StringVar(&applySchemaOptions.DDLStrategy, "ddl-strategy", string(schema.DDLStrategyDirect), "Online DDL strategy, compatible with @@ddl_strategy session variable (examples: 'gh-ost', 'pt-osc', 'gh-ost --max-load=Threads_running=100'.")
ApplySchema.Flags().StringSliceVar(&applySchemaOptions.UUIDList, "uuid", nil, "Optional, comma-delimited, repeatable, explicit UUIDs for migration. If given, must match number of DDL changes.")
ApplySchema.Flags().StringVar(&applySchemaOptions.MigrationContext, "migration-context", "", "For Online DDL, optionally supply a custom unique string used as context for the migration(s) in this command. By default a unique context is auto-generated by Vitess.")
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vtgate/cli/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"vitess.io/vitess/go/vt/discovery"
"vitess.io/vitess/go/vt/servenv"
"vitess.io/vitess/go/vt/srvtopo"
_ "vitess.io/vitess/go/vt/status"
"vitess.io/vitess/go/vt/vtgate"
)

Expand Down
1 change: 0 additions & 1 deletion go/cmd/vtorc/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func init() {
servenv.MoveFlagsToCobraCommand(Main)

logic.RegisterFlags(Main.Flags())
server.RegisterFlags(Main.Flags())
config.RegisterFlags(Main.Flags())
acl.RegisterFlags(Main.Flags())
Main.Flags().StringVar(&configFile, "config", "", "config file name")
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vttablet/cli/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package cli

import (
"vitess.io/vitess/go/vt/servenv"
_ "vitess.io/vitess/go/vt/status"
"vitess.io/vitess/go/vt/topo"
"vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication"
"vitess.io/vitess/go/vt/vttablet/tabletserver"
Expand Down
37 changes: 0 additions & 37 deletions go/vt/status/status.go

This file was deleted.

7 changes: 2 additions & 5 deletions go/vt/vtctld/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ import (
)

var (
localCell string
proxyTablets bool
showTopologyCRUD = true
localCell string
proxyTablets bool
)

// This file implements a REST-style API for the vtctld web interface.
Expand Down Expand Up @@ -86,8 +85,6 @@ func init() {
func registerVtctldAPIFlags(fs *pflag.FlagSet) {
fs.StringVar(&localCell, "cell", localCell, "cell to use")
fs.BoolVar(&proxyTablets, "proxy_tablets", proxyTablets, "Setting this true will make vtctld proxy the tablet status instead of redirecting to them")
fs.BoolVar(&showTopologyCRUD, "vtctld_show_topology_crud", showTopologyCRUD, "Controls the display of the CRUD topology actions in the vtctld UI.")
fs.MarkDeprecated("vtctld_show_topology_crud", "It is no longer applicable because vtctld no longer provides a UI.")
}

func newTabletWithURL(t *topodatapb.Tablet) *TabletWithURL {
Expand Down
3 changes: 0 additions & 3 deletions go/vt/vtctld/vtctld.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
)

var (
durabilityPolicy = "none"
sanitizeLogMessages = false
)

Expand All @@ -45,8 +44,6 @@ func init() {
}

func registerVtctldFlags(fs *pflag.FlagSet) {
fs.StringVar(&durabilityPolicy, "durability_policy", durabilityPolicy, "type of durability to enforce. Default is none. Other values are dictated by registered plugins")
fs.MarkDeprecated("durability_policy", "Set the correct durability policy in the keyspace information instead.")
fs.BoolVar(&sanitizeLogMessages, "vtctld_sanitize_log_messages", sanitizeLogMessages, "When true, vtctld sanitizes logging.")
}

Expand Down
2 changes: 0 additions & 2 deletions go/vt/vtorc/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ func RegisterFlags(fs *pflag.FlagSet) {
fs.DurationVar(&auditPurgeDuration, "audit-purge-duration", auditPurgeDuration, "Duration for which audit logs are held before being purged. Should be in multiples of days")
fs.DurationVar(&recoveryPeriodBlockDuration, "recovery-period-block-duration", recoveryPeriodBlockDuration, "Duration for which a new recovery is blocked on an instance after running a recovery")
fs.BoolVar(&preventCrossCellFailover, "prevent-cross-cell-failover", preventCrossCellFailover, "Prevent VTOrc from promoting a primary in a different cell than the current primary in case of a failover")
fs.Duration("lock-shard-timeout", 30*time.Second, "Duration for which a shard lock is held when running a recovery")
_ = fs.MarkDeprecated("lock-shard-timeout", "Please use lock-timeout instead.")
fs.DurationVar(&waitReplicasTimeout, "wait-replicas-timeout", waitReplicasTimeout, "Duration for which to wait for replica's to respond when issuing RPCs")
fs.DurationVar(&topoInformationRefreshDuration, "topo-information-refresh-duration", topoInformationRefreshDuration, "Timer duration on which VTOrc refreshes the keyspace and vttablet records from the topology server")
fs.DurationVar(&recoveryPollDuration, "recovery-poll-duration", recoveryPollDuration, "Timer duration on which VTOrc polls its database to run a recovery")
Expand Down
8 changes: 0 additions & 8 deletions go/vt/vtorc/server/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,11 @@ limitations under the License.
package server

import (
"github.com/spf13/pflag"

"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/vtorc/logic"
"vitess.io/vitess/go/vt/vtorc/process"
)

// RegisterFlags registers the flags required by VTOrc
func RegisterFlags(fs *pflag.FlagSet) {
fs.String("orc_web_dir", "", "")
fs.MarkDeprecated("orc_web_dir", "Web directory is no longer needed by VTOrc, please specify the --port flag to gain access to the debug pages and API of VTOrc")
}

// StartVTOrcDiscovery starts VTOrc discovery serving
func StartVTOrcDiscovery() {
process.ContinuousRegistration(string(process.VTOrcExecutionHTTPMode), "")
Expand Down
19 changes: 1 addition & 18 deletions go/vt/vttablet/tabletmanager/rpc_replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
"strings"
"time"

"github.com/spf13/pflag"

"vitess.io/vitess/go/mysql/replication"
"vitess.io/vitess/go/mysql/sqlerror"
"vitess.io/vitess/go/protoutil"
Expand All @@ -32,28 +30,13 @@ import (
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/mysqlctl"
"vitess.io/vitess/go/vt/proto/vtrpc"
"vitess.io/vitess/go/vt/servenv"
"vitess.io/vitess/go/vt/topo/topoproto"
"vitess.io/vitess/go/vt/vterrors"

replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
)

var disableReplicationManager bool

func registerReplicationFlags(fs *pflag.FlagSet) {
fs.Bool("use_super_read_only", true, "Set super_read_only flag when performing planned failover.")
fs.MarkDeprecated("use_super_read_only", "From v17 onwards MySQL server will always try to start with super_read_only=ON")
fs.BoolVar(&disableReplicationManager, "disable-replication-manager", disableReplicationManager, "Disable replication manager to prevent replication repairs.")
fs.MarkDeprecated("disable-replication-manager", "Replication manager is deleted")
}

func init() {
servenv.OnParseFor("vtcombo", registerReplicationFlags)
servenv.OnParseFor("vttablet", registerReplicationFlags)
}

// ReplicationStatus returns the replication status
func (tm *TabletManager) ReplicationStatus(ctx context.Context) (*replicationdatapb.Status, error) {
status, err := tm.MysqlDaemon.ReplicationStatus()
Expand Down Expand Up @@ -935,7 +918,7 @@ func (tm *TabletManager) fixSemiSyncAndReplication(tabletType topodatapb.TabletT
return nil
}

//shouldAck := semiSync == SemiSyncActionSet
// shouldAck := semiSync == SemiSyncActionSet
shouldAck := isPrimaryEligible(tabletType)
acking, err := tm.MysqlDaemon.SemiSyncReplicationStatus()
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions go/vt/vttablet/tabletmanager/tm_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ func registerInitFlags(fs *pflag.FlagSet) {
fs.StringVar(&initDbNameOverride, "init_db_name_override", initDbNameOverride, "(init parameter) override the name of the db used by vttablet. Without this flag, the db name defaults to vt_<keyspacename>")
fs.StringVar(&skipBuildInfoTags, "vttablet_skip_buildinfo_tags", skipBuildInfoTags, "comma-separated list of buildinfo tags to skip from merging with --init_tags. each tag is either an exact match or a regular expression of the form '/regexp/'.")
fs.Var(&initTags, "init_tags", "(init parameter) comma separated list of key:value pairs used to tag the tablet")
fs.BoolVar(&initPopulateMetadata, "init_populate_metadata", initPopulateMetadata, "(init parameter) populate metadata tables even if restore_from_backup is disabled. If restore_from_backup is enabled, metadata tables are always populated regardless of this flag.")
fs.MarkDeprecated("init_populate_metadata", "this flag is no longer being used and will be removed in future versions")
fs.DurationVar(&initTimeout, "init_timeout", initTimeout, "(init parameter) timeout to use for the init phase.")
}

Expand Down
51 changes: 22 additions & 29 deletions go/vt/vttablet/tabletserver/connpool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,20 @@ const (
// Other than the connection type, ConnPool maintains an additional
// pool of dba connections that are used to kill connections.
type Pool struct {
env tabletenv.Env
name string
mu sync.Mutex
connections pools.IResourcePool
capacity int
prefillParallelism int
timeout time.Duration
idleTimeout time.Duration
maxLifetime time.Duration
waiterCap int64
waiterCount atomic.Int64
waiterQueueFull atomic.Int64
dbaPool *dbconnpool.ConnectionPool
appDebugParams dbconfigs.Connector
getConnTime *servenv.TimingsWrapper
env tabletenv.Env
name string
mu sync.Mutex
connections pools.IResourcePool
capacity int
timeout time.Duration
idleTimeout time.Duration
maxLifetime time.Duration
waiterCap int64
waiterCount atomic.Int64
waiterQueueFull atomic.Int64
dbaPool *dbconnpool.ConnectionPool
appDebugParams dbconfigs.Connector
getConnTime *servenv.TimingsWrapper
}

// NewPool creates a new Pool. The name is used
Expand All @@ -78,15 +77,14 @@ func NewPool(env tabletenv.Env, name string, cfg tabletenv.ConnPoolConfig) *Pool
idleTimeout := cfg.IdleTimeoutSeconds.Get()
maxLifetime := cfg.MaxLifetimeSeconds.Get()
cp := &Pool{
env: env,
name: name,
capacity: cfg.Size,
prefillParallelism: cfg.PrefillParallelism,
timeout: cfg.TimeoutSeconds.Get(),
idleTimeout: idleTimeout,
maxLifetime: maxLifetime,
waiterCap: int64(cfg.MaxWaiters),
dbaPool: dbconnpool.NewConnectionPool("", 1, idleTimeout, maxLifetime, 0),
env: env,
name: name,
capacity: cfg.Size,
timeout: cfg.TimeoutSeconds.Get(),
idleTimeout: idleTimeout,
maxLifetime: maxLifetime,
waiterCap: int64(cfg.MaxWaiters),
dbaPool: dbconnpool.NewConnectionPool("", 1, idleTimeout, maxLifetime, 0),
}
if name == "" {
return cp
Expand Down Expand Up @@ -124,11 +122,6 @@ func (cp *Pool) Open(appParams, dbaParams, appDebugParams dbconfigs.Connector) {
cp.mu.Lock()
defer cp.mu.Unlock()

if cp.prefillParallelism != 0 {
log.Infof("Opening pool: '%s'", cp.name)
defer log.Infof("Done opening pool: '%s'", cp.name)
}

f := func(ctx context.Context) (pools.Resource, error) {
return NewDBConn(ctx, cp, appParams)
}
Expand Down
9 changes: 0 additions & 9 deletions go/vt/vttablet/tabletserver/tabletenv/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,8 @@ func registerTabletEnvFlags(fs *pflag.FlagSet) {
fs.StringVar(&txLogHandler, "transaction-log-stream-handler", txLogHandler, "URL handler for streaming transactions log")

fs.IntVar(&currentConfig.OltpReadPool.Size, "queryserver-config-pool-size", defaultConfig.OltpReadPool.Size, "query server read pool size, connection pool is used by regular queries (non streaming, not in a transaction)")
fs.IntVar(&currentConfig.OltpReadPool.PrefillParallelism, "queryserver-config-pool-prefill-parallelism", defaultConfig.OltpReadPool.PrefillParallelism, "Query server read pool prefill parallelism, a non-zero value will prefill the pool using the specified parallism.")
_ = fs.MarkDeprecated("queryserver-config-pool-prefill-parallelism", "it will be removed in a future release.")
fs.IntVar(&currentConfig.OlapReadPool.Size, "queryserver-config-stream-pool-size", defaultConfig.OlapReadPool.Size, "query server stream connection pool size, stream pool is used by stream queries: queries that return results to client in a streaming fashion")
fs.IntVar(&currentConfig.OlapReadPool.PrefillParallelism, "queryserver-config-stream-pool-prefill-parallelism", defaultConfig.OlapReadPool.PrefillParallelism, "Query server stream pool prefill parallelism, a non-zero value will prefill the pool using the specified parallelism")
_ = fs.MarkDeprecated("queryserver-config-stream-pool-prefill-parallelism", "it will be removed in a future release.")
fs.IntVar(&currentConfig.TxPool.Size, "queryserver-config-transaction-cap", defaultConfig.TxPool.Size, "query server transaction cap is the maximum number of transactions allowed to happen at any given point of a time for a single vttablet. E.g. by setting transaction cap to 100, there are at most 100 transactions will be processed by a vttablet and the 101th transaction will be blocked (and fail if it cannot get connection within specified timeout)")
fs.IntVar(&currentConfig.TxPool.PrefillParallelism, "queryserver-config-transaction-prefill-parallelism", defaultConfig.TxPool.PrefillParallelism, "Query server transaction prefill parallelism, a non-zero value will prefill the pool using the specified parallism.")
_ = fs.MarkDeprecated("queryserver-config-transaction-prefill-parallelism", "it will be removed in a future release.")
fs.IntVar(&currentConfig.MessagePostponeParallelism, "queryserver-config-message-postpone-cap", defaultConfig.MessagePostponeParallelism, "query server message postpone cap is the maximum number of messages that can be postponed at any given time. Set this number to substantially lower than transaction cap, so that the transaction pool isn't exhausted by the message subsystem.")
currentConfig.Oltp.TxTimeoutSeconds = defaultConfig.Oltp.TxTimeoutSeconds.Clone()
fs.Var(&currentConfig.Oltp.TxTimeoutSeconds, currentConfig.Oltp.TxTimeoutSeconds.Name(), "query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value")
Expand All @@ -148,9 +142,6 @@ func registerTabletEnvFlags(fs *pflag.FlagSet) {

currentConfig.SchemaReloadIntervalSeconds = defaultConfig.SchemaReloadIntervalSeconds.Clone()
fs.Var(&currentConfig.SchemaReloadIntervalSeconds, currentConfig.SchemaReloadIntervalSeconds.Name(), "query server schema reload time, how often vttablet reloads schemas from underlying MySQL instance in seconds. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time.")
currentConfig.SignalSchemaChangeReloadIntervalSeconds = defaultConfig.SignalSchemaChangeReloadIntervalSeconds.Clone()
fs.Var(&currentConfig.SignalSchemaChangeReloadIntervalSeconds, "queryserver-config-schema-change-signal-interval", "query server schema change signal interval defines at which interval the query server shall send schema updates to vtgate.")
_ = fs.MarkDeprecated("queryserver-config-schema-change-signal-interval", "We no longer poll for finding schema changes.")
fs.DurationVar(&currentConfig.SchemaChangeReloadTimeout, "schema-change-reload-timeout", defaultConfig.SchemaChangeReloadTimeout, "query server schema change reload timeout, this is how long to wait for the signaled schema reload operation to complete before giving up")
fs.BoolVar(&currentConfig.SignalWhenSchemaChange, "queryserver-config-schema-change-signal", defaultConfig.SignalWhenSchemaChange, "query server schema signal, will signal connected vtgates that schema has changed whenever this is detected. VTGates will need to have -schema_change_signal enabled for this to work")
currentConfig.Olap.TxTimeoutSeconds = defaultConfig.Olap.TxTimeoutSeconds.Clone()
Expand Down
10 changes: 4 additions & 6 deletions go/vt/vttablet/tabletserver/tabletenv/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ func TestConfigParse(t *testing.T) {
},
},
OltpReadPool: ConnPoolConfig{
Size: 16,
PrefillParallelism: 30,
MaxWaiters: 40,
Size: 16,
MaxWaiters: 40,
},
RowStreamer: RowStreamerConfig{
MaxInnoDBTrxHistLen: 1000,
Expand Down Expand Up @@ -181,9 +180,8 @@ func TestClone(t *testing.T) {

cfg1 := &TabletConfig{
OltpReadPool: ConnPoolConfig{
Size: 16,
PrefillParallelism: 30,
MaxWaiters: 40,
Size: 16,
MaxWaiters: 40,
},
RowStreamer: RowStreamerConfig{
MaxInnoDBTrxHistLen: 1000000,
Expand Down

0 comments on commit 7eb6c68

Please sign in to comment.