Skip to content

Commit

Permalink
Online DDL: removal of gh-ost and pt-osc strategies (#17626)
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach authored Feb 6, 2025
1 parent 747c308 commit cf28afa
Show file tree
Hide file tree
Showing 24 changed files with 2,350 additions and 3,338 deletions.
16 changes: 16 additions & 0 deletions changelog/22.0/22.0.0/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- **[Major Changes](#major-changes)**
- **[Deprecations and Deletions](#deprecations-and-deletions)**
- [Deprecated VTTablet Flags](#vttablet-flags)
- [Removing gh-ost and pt-osc Online DDL strategies](#ghost-ptosc)
- **[RPC Changes](#rpc-changes)**
- **[Prefer not promoting a replica that is currently taking a backup](#reparents-prefer-not-backing-up)**
- **[VTOrc Config File Changes](#vtorc-config-file-changes)**
Expand Down Expand Up @@ -38,6 +39,21 @@ These are the RPC changes made in this release -

- `twopc_enable` flag is deprecated. Usage of TwoPC commit will be determined by the `transaction_mode` set on VTGate via flag or session variable.

#### <a id="ghost-ptosc"/>Removing gh-ost and pt-osc Online DDL strategies</a>

Vitess no longer recognizes the `gh-ost` and `pt-osc` (`pt-online-schema-change`) Online DDL strategies. The `vitess` strategy is the recommended way to make schema changes at scale. `mysql` and `direct` strategies continue to be supported.

These `vttablet` flags have been removed:

- `--gh-ost-path`
- `--pt-osc-path`

The use of `gh-ost` and `pt-osc` as strategies as follows, yields an error:
```sh
$ vtctldclient ApplySchema --ddl-strategy="gh-ost" ...
$ vtctldclient ApplySchema --ddl-strategy="pt-osc" ...
```

### <a id="reparents-prefer-not-backing-up"/>Prefer not promoting a replica that is currently taking a backup

Emergency reparents now prefer not promoting replicas that are currently taking backups with a backup engine other than
Expand Down
4 changes: 2 additions & 2 deletions go/cmd/vtctldclient/command/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
Long: `Applies the schema change to the specified keyspace on every primary, running in parallel on all shards. The changes are then propagated to replicas via replication.
If --allow-long-unavailability is set, schema changes affecting a large number of rows (and possibly incurring a longer period of unavailability) will not be rejected.
--ddl-strategy is used to instruct migrations via vreplication, gh-ost or pt-osc with optional parameters.
--ddl-strategy is used to instruct migrations via vreplication, mysql or direct with optional parameters.
--migration-context allows the user to specify a custom migration context for online DDL migrations.
If --skip-preflight, SQL goes directly to shards without going through sanity checks.
Expand Down Expand Up @@ -430,7 +430,7 @@ func commandValidateSchemaShard(cmd *cobra.Command, args []string) error {
}

func init() {
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().StringVar(&applySchemaOptions.DDLStrategy, "ddl-strategy", string(schema.DDLStrategyDirect), "Online DDL strategy, compatible with @@ddl_strategy session variable (examples: 'direct', 'mysql', 'vitess --postpone-completion'.")
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.")
ApplySchema.Flags().DurationVar(&applySchemaOptions.WaitReplicasTimeout, "wait-replicas-timeout", grpcvtctldserver.DefaultWaitReplicasTimeout, "Amount of time to wait for replicas to receive the schema change via replication.")
Expand Down
2 changes: 0 additions & 2 deletions go/flags/endtoend/vtcombo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ Flags:
--gate_query_cache_memory int gate server query cache size in bytes, maximum amount of memory to be cached. vtgate analyzes every incoming query and generate a query plan, these plans are being cached in a lru cache. This config controls the capacity of the lru cache. (default 33554432)
--gc_check_interval duration Interval between garbage collection checks (default 1h0m0s)
--gc_purge_check_interval duration Interval between purge discovery checks (default 1m0s)
--gh-ost-path string override default gh-ost binary full path (default "gh-ost")
--grpc-send-session-in-streaming If set, will send the session as last packet in streaming api to support transactions in streaming
--grpc-use-effective-groups If set, and SSL is not used, will set the immediate caller's security groups from the effective caller id's groups.
--grpc-use-static-authentication-callerid If set, will set the immediate caller id to the username authenticated by the static auth plugin.
Expand Down Expand Up @@ -265,7 +264,6 @@ Flags:
--proto_topo vttest.TopoData vttest proto definition of the topology, encoded in compact text format. See vttest.proto for more information.
--proxy_protocol Enable HAProxy PROXY protocol on MySQL listener socket
--proxy_tablets Setting this true will make vtctld proxy the tablet status instead of redirecting to them
--pt-osc-path string override default pt-online-schema-change binary full path (default "/usr/bin/pt-online-schema-change")
--publish_retry_interval duration how long vttablet waits to retry publishing the tablet record (default 30s)
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--query-log-stream-handler string URL handler for streaming queries log (default "/debug/querylog")
Expand Down
2 changes: 0 additions & 2 deletions go/flags/endtoend/vttablet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ Flags:
--gc_purge_check_interval duration Interval between purge discovery checks (default 1m0s)
--gcs_backup_storage_bucket string Google Cloud Storage bucket to use for backups.
--gcs_backup_storage_root string Root prefix for all backup-related object names.
--gh-ost-path string override default gh-ost binary full path (default "gh-ost")
--grpc-dial-concurrency-limit int Maximum concurrency of grpc dial operations. This should be less than the golang max thread limit of 10000. (default 1024)
--grpc_auth_mode string Which auth plugin implementation to use (eg: static)
--grpc_auth_mtls_allowed_substrings string List of substrings of at least one of the client certificate names (separated by colon).
Expand Down Expand Up @@ -259,7 +258,6 @@ Flags:
--port int port for the server
--pprof strings enable profiling
--pprof-http enable pprof http endpoints
--pt-osc-path string override default pt-online-schema-change binary full path (default "/usr/bin/pt-online-schema-change")
--publish_retry_interval duration how long vttablet waits to retry publishing the tablet record (default 30s)
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--query-log-stream-handler string URL handler for streaming queries log (default "/debug/querylog")
Expand Down
Loading

0 comments on commit cf28afa

Please sign in to comment.