Skip to content

Commit

Permalink
Cleanup vreplication tablet flags.
Browse files Browse the repository at this point in the history
Remove long deprecated flags and deprecate additional
unnecessary ones.

Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Oct 17, 2023
1 parent 46f6ae5 commit c6a626b
Show file tree
Hide file tree
Showing 16 changed files with 9 additions and 47 deletions.
5 changes: 1 addition & 4 deletions go/flags/endtoend/vtcombo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -401,17 +401,14 @@ Flags:
--vreplication_copy_phase_max_innodb_history_list_length int The maximum InnoDB transaction history that can exist on a vstreamer (source) before starting another round of copying rows. This helps to limit the impact on the source tablet. (default 1000000)
--vreplication_copy_phase_max_mysql_replication_lag int The maximum MySQL replication lag (in seconds) that can exist on a vstreamer (source) before starting another round of copying rows. This helps to limit the impact on the source tablet. (default 43200)
--vreplication_experimental_flags int (Bitmask) of experimental features in vreplication to enable (default 3)
--vreplication_healthcheck_retry_delay duration healthcheck retry delay (default 5s)
--vreplication_healthcheck_timeout duration healthcheck retry delay (default 1m0s)
--vreplication_healthcheck_topology_refresh duration refresh interval for re-reading the topology (default 30s)
--vreplication_heartbeat_update_interval int Frequency (in seconds, default 1, max 60) at which the time_updated column of a vreplication stream when idling (default 1)
--vreplication_max_time_to_retry_on_error duration stop automatically retrying when we've had consecutive failures with the same error for this long after the first occurrence
--vreplication_net_read_timeout int Session value of net_read_timeout for vreplication, in seconds (default 300)
--vreplication_net_write_timeout int Session value of net_write_timeout for vreplication, in seconds (default 600)
--vreplication_replica_lag_tolerance duration Replica lag threshold duration: once lag is below this we switch from copy phase to the replication (streaming) phase (default 1m0s)
--vreplication_retry_delay duration delay before retrying a failed workflow event in the replication phase (default 5s)
--vreplication_store_compressed_gtid Store compressed gtids in the pos column of the sidecar database's vreplication table
--vreplication_tablet_type string comma separated list of tablet types used as a source (default "in_order:REPLICA,PRIMARY")
--vreplication_tablet_type string Deprecated: comma separated list of tablet types used as a source (ignored) (default "in_order:REPLICA,PRIMARY")
--vschema-persistence-dir string If set, per-keyspace vschema will be persisted in this directory and reloaded into the in-memory topology server across restarts. Bookkeeping is performed using a simple watcher goroutine. This is useful when running vtcombo as an application development container (e.g. vttestserver) where you want to keep the same vschema even if developer's machine reboots. This works in tandem with vttestserver's --persistent_mode flag. Needless to say, this is neither a perfect nor a production solution for vschema persistence. Consider using the --external_topo_server flag if you require a more complete solution. This flag is ignored if --external_topo_server is set.
--vschema_ddl_authorized_users string List of users authorized to execute vschema ddl operations, or '%' to allow all users.
--vstream-binlog-rotation-threshold int Byte size at which a VStreamer will attempt to rotate the source's open binary log before starting a GTID snapshot based stream (e.g. a ResultStreamer or RowStreamer) (default 67108864)
Expand Down
5 changes: 1 addition & 4 deletions go/flags/endtoend/vttablet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -406,17 +406,14 @@ Flags:
--vreplication_copy_phase_max_innodb_history_list_length int The maximum InnoDB transaction history that can exist on a vstreamer (source) before starting another round of copying rows. This helps to limit the impact on the source tablet. (default 1000000)
--vreplication_copy_phase_max_mysql_replication_lag int The maximum MySQL replication lag (in seconds) that can exist on a vstreamer (source) before starting another round of copying rows. This helps to limit the impact on the source tablet. (default 43200)
--vreplication_experimental_flags int (Bitmask) of experimental features in vreplication to enable (default 3)
--vreplication_healthcheck_retry_delay duration healthcheck retry delay (default 5s)
--vreplication_healthcheck_timeout duration healthcheck retry delay (default 1m0s)
--vreplication_healthcheck_topology_refresh duration refresh interval for re-reading the topology (default 30s)
--vreplication_heartbeat_update_interval int Frequency (in seconds, default 1, max 60) at which the time_updated column of a vreplication stream when idling (default 1)
--vreplication_max_time_to_retry_on_error duration stop automatically retrying when we've had consecutive failures with the same error for this long after the first occurrence
--vreplication_net_read_timeout int Session value of net_read_timeout for vreplication, in seconds (default 300)
--vreplication_net_write_timeout int Session value of net_write_timeout for vreplication, in seconds (default 600)
--vreplication_replica_lag_tolerance duration Replica lag threshold duration: once lag is below this we switch from copy phase to the replication (streaming) phase (default 1m0s)
--vreplication_retry_delay duration delay before retrying a failed workflow event in the replication phase (default 5s)
--vreplication_store_compressed_gtid Store compressed gtids in the pos column of the sidecar database's vreplication table
--vreplication_tablet_type string comma separated list of tablet types used as a source (default "in_order:REPLICA,PRIMARY")
--vreplication_tablet_type string Deprecated: comma separated list of tablet types used as a source (ignored) (default "in_order:REPLICA,PRIMARY")
--vstream-binlog-rotation-threshold int Byte size at which a VStreamer will attempt to rotate the source's open binary log before starting a GTID snapshot based stream (e.g. a ResultStreamer or RowStreamer) (default 67108864)
--vstream_dynamic_packet_size Enable dynamic packet sizing for VReplication. This will adjust the packet size during replication to improve performance. (default true)
--vstream_packet_size int Suggested packet size for VReplication streamer. This is used only as a recommendation. The actual packet size may be more or less than this amount. (default 250000)
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/backup/vtbackup/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ var (
shardKsName = fmt.Sprintf("%s/%s", keyspaceName, shardName)
dbCredentialFile string
commonTabletArg = []string{
"--vreplication_healthcheck_topology_refresh", "1s",
"--vreplication_healthcheck_retry_delay", "1s",
"--vreplication_retry_delay", "1s",
"--degraded_threshold", "5s",
"--lock_tables_timeout", "5s",
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/backup/vtctlbackup/backup_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ var (
dbCredentialFile string
shardName = "0"
commonTabletArg = []string{
"--vreplication_healthcheck_topology_refresh", "1s",
"--vreplication_healthcheck_retry_delay", "1s",
"--vreplication_retry_delay", "1s",
"--degraded_threshold", "5s",
"--lock_tables_timeout", "5s",
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/cellalias/cell_alias_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ var (
) Engine=InnoDB
`
commonTabletArg = []string{
"--vreplication_healthcheck_topology_refresh", "1s",
"--vreplication_healthcheck_retry_delay", "1s",
"--vreplication_retry_delay", "1s",
"--degraded_threshold", "5s",
"--lock_tables_timeout", "5s",
Expand Down
3 changes: 0 additions & 3 deletions go/test/endtoend/cluster/vttablet_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ type VttabletProcess struct {
ServingStatus string
DbPassword string
DbPort int
VreplicationTabletType string
DbFlavor string
Charset string
ConsolidationsURL string
Expand Down Expand Up @@ -109,7 +108,6 @@ func (vttablet *VttabletProcess) Setup() (err error) {
"--backup_storage_implementation", vttablet.BackupStorageImplementation,
"--file_backup_storage_root", vttablet.FileBackupStorageRoot,
"--service_map", vttablet.ServiceMap,
"--vreplication_tablet_type", vttablet.VreplicationTabletType,
"--db_charset", vttablet.Charset,
)
if v, err := GetMajorVersion("vttablet"); err != nil {
Expand Down Expand Up @@ -659,7 +657,6 @@ func VttabletProcessInstance(port, grpcPort, tabletUID int, cell, shard, keyspac
ServingStatus: "NOT_SERVING",
BackupStorageImplementation: "file",
FileBackupStorageRoot: path.Join(os.Getenv("VTDATAROOT"), "/backups"),
VreplicationTabletType: "replica",
TabletUID: tabletUID,
Charset: charset,
}
Expand Down
5 changes: 0 additions & 5 deletions go/test/endtoend/recovery/pitr/shardedpitr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ var (
}
}`
commonTabletArg = []string{
"--vreplication_healthcheck_topology_refresh", "1s",
"--vreplication_healthcheck_retry_delay", "1s",
"--vreplication_retry_delay", "1s",
"--degraded_threshold", "5s",
"--lock_tables_timeout", "5s",
Expand Down Expand Up @@ -558,9 +556,6 @@ func launchRecoveryTablet(t *testing.T, tablet *cluster.Vttablet, binlogServer *
"--binlog_user", binlogServer.username,
"--binlog_password", binlogServer.password,
"--pitr_gtid_lookup_timeout", lookupTimeout,
"--vreplication_healthcheck_topology_refresh", "1s",
"--vreplication_healthcheck_retry_delay", "1s",
"--vreplication_tablet_type", "replica",
"--vreplication_retry_delay", "1s",
"--degraded_threshold", "5s",
"--lock_tables_timeout", "5s",
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/recovery/unshardedrecovery/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ var (
dbCredentialFile string
shardName = "0"
commonTabletArg = []string{
"--vreplication_healthcheck_topology_refresh", "1s",
"--vreplication_healthcheck_retry_delay", "1s",
"--vreplication_retry_delay", "1s",
"--degraded_threshold", "5s",
"--lock_tables_timeout", "5s",
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/topoconncache/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ var (
) Engine=InnoDB
`
commonTabletArg = []string{
"--vreplication_healthcheck_topology_refresh", "1s",
"--vreplication_healthcheck_retry_delay", "1s",
"--vreplication_retry_delay", "1s",
"--degraded_threshold", "5s",
"--lock_tables_timeout", "5s",
Expand Down
2 changes: 0 additions & 2 deletions go/test/endtoend/vault/vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ var (
vtgateUser = "vtgate_user"
vtgatePassword = "password123"
commonTabletArg = []string{
"--vreplication_healthcheck_topology_refresh", "1s",
"--vreplication_healthcheck_retry_delay", "1s",
"--vreplication_retry_delay", "1s",
"--degraded_threshold", "5s",
"--lock_tables_timeout", "5s",
Expand Down
5 changes: 2 additions & 3 deletions go/test/endtoend/vreplication/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ func (vc *VitessCluster) AddShards(t *testing.T, cells []*Cell, keyspace *Keyspa
require.NoError(t, err)
require.NotNil(t, primary)
tabletIndex++
primary.Vttablet.VreplicationTabletType = "PRIMARY"
tablets = append(tablets, primary)
dbProcesses = append(dbProcesses, proc)
primaryTabletUID = primary.Vttablet.TabletUID
Expand Down Expand Up @@ -776,7 +775,7 @@ func (vc *VitessCluster) getVttabletsInKeyspace(t *testing.T, cell *Cell, ksName
tablets := make(map[string]*cluster.VttabletProcess)
for _, shard := range keyspace.Shards {
for _, tablet := range shard.Tablets {
if tablet.Vttablet.GetTabletStatus() == "SERVING" && strings.EqualFold(tablet.Vttablet.VreplicationTabletType, tabletType) {
if tablet.Vttablet.GetTabletStatus() == "SERVING" {
log.Infof("Serving status of tablet %s is %s, %s", tablet.Name, tablet.Vttablet.ServingStatus, tablet.Vttablet.GetTabletStatus())
tablets[tablet.Name] = tablet.Vttablet
}
Expand All @@ -796,7 +795,7 @@ func (vc *VitessCluster) getPrimaryTablet(t *testing.T, ksName, shardName string
continue
}
for _, tablet := range shard.Tablets {
if tablet.Vttablet.GetTabletStatus() == "SERVING" && strings.EqualFold(tablet.Vttablet.VreplicationTabletType, "primary") {
if tablet.Vttablet.GetTabletStatus() == "SERVING" {
return tablet.Vttablet
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ func TestMain(m *testing.M) {
"--heartbeat_on_demand_duration", "5s",
"--migration_check_interval", "5s",
"--watch_replication_stream",
"--vreplication_tablet_type", "primary",
}
clusterInstance.VtGateExtraArgs = []string{}

Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtctl/vtctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ func commandVReplicationWorkflow(ctx context.Context, wr *wrangler.Wrangler, sub
const defaultMaxReplicationLagAllowed = defaultWaitTime

cells := subFlags.String("cells", "", "Cell(s) or CellAlias(es) (comma-separated) to replicate from.")
tabletTypesStr := subFlags.String("tablet_types", "in_order:REPLICA,PRIMARY", "Source tablet types to replicate from (e.g. PRIMARY, REPLICA, RDONLY). Defaults to --vreplication_tablet_type parameter value for the tablet, which has the default value of in_order:REPLICA,PRIMARY. Note: SwitchTraffic overrides this default and uses in_order:RDONLY,REPLICA,PRIMARY to switch all traffic by default.")
tabletTypesStr := subFlags.String("tablet_types", "in_order:REPLICA,PRIMARY", "Source tablet types to replicate from (e.g. PRIMARY, REPLICA, RDONLY). Note: SwitchTraffic overrides this default and uses in_order:RDONLY,REPLICA,PRIMARY to switch all traffic by default.")
dryRun := subFlags.Bool("dry_run", false, "Does a dry run of SwitchTraffic and only reports the actions to be taken. --dry_run is only supported for SwitchTraffic, ReverseTraffic and Complete.")
timeout := subFlags.Duration("timeout", defaultWaitTime, "Specifies the maximum time to wait, in seconds, for vreplication to catch up on primary migrations. The migration will be cancelled on a timeout. --timeout is only supported for SwitchTraffic and ReverseTraffic.")
reverseReplication := subFlags.Bool("reverse_replication", true, "Also reverse the replication (default true). --reverse_replication is only supported for SwitchTraffic.")
Expand Down
12 changes: 3 additions & 9 deletions go/vt/vttablet/tabletmanager/vreplication/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ func registerVReplicationFlags(fs *pflag.FlagSet) {
fs.DurationVar(&retryDelay, "vreplication_retry_delay", retryDelay, "delay before retrying a failed workflow event in the replication phase")
fs.DurationVar(&maxTimeToRetryError, "vreplication_max_time_to_retry_on_error", maxTimeToRetryError, "stop automatically retrying when we've had consecutive failures with the same error for this long after the first occurrence")

// these are the default tablet_types that will be used by the tablet picker to find source tablets for a vreplication stream
// it can be overridden by passing a different list to the MoveTables or Reshard commands
fs.StringVar(&tabletTypesStr, "vreplication_tablet_type", tabletTypesStr, "comma separated list of tablet types used as a source")

fs.IntVar(&relayLogMaxSize, "relay_log_max_size", relayLogMaxSize, "Maximum buffer size (in bytes) for VReplication target buffering. If single rows are larger than this, a single row is buffered at a time.")
fs.IntVar(&relayLogMaxItems, "relay_log_max_items", relayLogMaxItems, "Maximum number of rows for VReplication target buffering.")

Expand All @@ -62,12 +58,10 @@ func registerVReplicationFlags(fs *pflag.FlagSet) {
fs.IntVar(&vreplicationHeartbeatUpdateInterval, "vreplication_heartbeat_update_interval", vreplicationHeartbeatUpdateInterval, "Frequency (in seconds, default 1, max 60) at which the time_updated column of a vreplication stream when idling")
fs.BoolVar(&vreplicationStoreCompressedGTID, "vreplication_store_compressed_gtid", vreplicationStoreCompressedGTID, "Store compressed gtids in the pos column of the sidecar database's vreplication table")

// deprecated flags (7.0), however there are several e2e tests that still depend on them
fs.Duration("vreplication_healthcheck_topology_refresh", 30*time.Second, "refresh interval for re-reading the topology")
fs.Duration("vreplication_healthcheck_retry_delay", 5*time.Second, "healthcheck retry delay")
fs.Duration("vreplication_healthcheck_timeout", 1*time.Minute, "healthcheck retry delay")

fs.IntVar(&vreplicationParallelInsertWorkers, "vreplication-parallel-insert-workers", vreplicationParallelInsertWorkers, "Number of parallel insertion workers to use during copy phase. Set <= 1 to disable parallelism, or > 1 to enable concurrent insertion during copy phase.")

// Deprecated and ignored in v19.
fs.String("vreplication_tablet_type", tabletTypesStr, "Deprecated: comma separated list of tablet types used as a source (ignored)")
}

func init() {
Expand Down
5 changes: 1 addition & 4 deletions go/vt/wrangler/traffic_switcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,8 @@ func (wr *Wrangler) areTabletsAvailableToStreamFrom(ctx context.Context, ts *tra
if ts.optCells != "" {
cells = strings.Split(ts.optCells, ",")
}
// FIXME: currently there is a default setting in the tablet that is used if user does not specify a tablet type,
// we use the value specified in the tablet flag `-vreplication_tablet_type`
// but ideally we should populate the vreplication table with a default value when we setup the workflow
if tabletTypes == "" {
tabletTypes = "PRIMARY,REPLICA"
tabletTypes = "in_order:REPLICA,PRIMARY" // default
}

var wg sync.WaitGroup
Expand Down
1 change: 0 additions & 1 deletion vitess-mixin/e2e/vttablet-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ if [ $tablet_role = "externalprimary" ]; then
--enable_replication_reporter=false \
--enforce_strict_trans_tables=false \
--track_schema_versions=true \
--vreplication_tablet_type=primary \
--watch_replication_stream=true"
else
external_db_args="--init_db_name_override $DB_NAME \
Expand Down

0 comments on commit c6a626b

Please sign in to comment.