-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ApplySchema: deprecate '--skip_preflight' flag #10716
Changes from 7 commits
c7857c1
4e7cdbf
6c63668
5c80d8d
92b84bc
1e9d657
aadaa8e
5db8806
2b2cfd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -611,8 +611,8 @@ var commands = []commandGroup{ | |
{ | ||
name: "ApplySchema", | ||
method: commandApplySchema, | ||
params: "[--allow_long_unavailability] [--wait_replicas_timeout=10s] [--ddl_strategy=<ddl_strategy>] [--uuid_list=<comma_separated_uuids>] [--migration_context=<unique-request-context>] [--skip_preflight] {--sql=<sql> || --sql-file=<filename>} <keyspace>", | ||
help: "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. -migration_context allows the user to specify a custom request context for online DDL migrations. If -skip_preflight, SQL goes directly to shards without going through sanity checks.", | ||
params: "[--allow_long_unavailability] [--wait_replicas_timeout=10s] [--ddl_strategy=<ddl_strategy>] [--uuid_list=<comma_separated_uuids>] [--migration_context=<unique-request-context>] {--sql=<sql> || --sql-file=<filename>} <keyspace>", | ||
help: "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. -migration_context allows the user to specify a custom request context for online DDL migrations.", | ||
}, | ||
{ | ||
name: "CopySchemaShard", | ||
|
@@ -3064,7 +3064,7 @@ func commandApplySchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl | |
migrationContext := subFlags.String("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") | ||
requestContext := subFlags.String("request_context", "", "synonym for --migration_context") | ||
waitReplicasTimeout := subFlags.Duration("wait_replicas_timeout", wrangler.DefaultWaitReplicasTimeout, "The amount of time to wait for replicas to receive the schema change via replication.") | ||
skipPreflight := subFlags.Bool("skip_preflight", false, "Skip pre-apply schema checks, and directly forward schema change query to shards") | ||
skipPreflight := subFlags.Bool("skip_preflight", false, "Deprecated. Always assumed to be 'true'") | ||
|
||
callerID := subFlags.String("caller_id", "", "This is the effective caller ID used for the operation and should map to an ACL name which grants this identity the necessary permissions to perform the operation (this is only necessary when strict table ACLs are used)") | ||
if err := subFlags.Parse(args); err != nil { | ||
|
@@ -3073,7 +3073,9 @@ func commandApplySchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl | |
if subFlags.NArg() != 1 { | ||
return fmt.Errorf("the <keyspace> argument is required for the commandApplySchema command") | ||
} | ||
|
||
if *skipPreflight { | ||
log.Warningf("--skip_preflight flag is deprecated. Always assumed to be 'true'") | ||
} | ||
// 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` | ||
|
@@ -3110,7 +3112,7 @@ func commandApplySchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *fl | |
AllowLongUnavailability: *allowLongUnavailability, | ||
DdlStrategy: *ddlStrategy, | ||
Sql: parts, | ||
SkipPreflight: *skipPreflight, | ||
SkipPreflight: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps we should be deprecating the protobuf field for this as well? I'm not certain about that though - whether we do this now and deprecate the protobuf field in the next release. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i know i just said "yes" on the other PR, but i think we need to wait one more cycle, since old tablets will be consuming this field, which will take the zero value ( so deprecate flag + always pass |
||
UuidList: textutil.SplitDelimitedList(*uuidList), | ||
MigrationContext: *migrationContext, | ||
WaitReplicasTimeout: protoutil.DurationToProto(*waitReplicasTimeout), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments I made in #10717 (comment), but for this flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments addressed