Skip to content

Commit

Permalink
[15.0] Deprecate InitShardPrimary command (#11557)
Browse files Browse the repository at this point in the history
* feat: deprecate initshardprimary

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: add summary docs

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: deprecate the correct command

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: fix expected output

Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
  • Loading branch information
GuptaManan100 authored Oct 21, 2022
1 parent 4848d69 commit 6b2208b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions doc/releasenotes/15_0_0_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ The connection pool with prefilled connections have been removed. The pool now d
Following flags are deprecated: `queryserver-config-pool-prefill-parallelism`, `queryserver-config-stream-pool-prefill-parallelism`, `queryserver-config-transaction-prefill-parallelism`
and will be removed in future version.

#### InitShardPrimary Deprecation

The vtcltd command InitShardPrimary has been deprecated. Please use PlannedReparentShard instead.

### Command-line syntax deprecations

#### vttablet startup flag deletions
Expand Down
1 change: 1 addition & 0 deletions go/cmd/vtctldclient/command/reparents.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ WARNING: this can cause data loss on an already-replicating shard. PlannedRepare
EmergencyReparentShard should be used instead.
`,
DisableFlagsInUseLine: true,
Deprecated: "Please use PlannedReparentShard instead",
Args: cobra.ExactArgs(2),
RunE: commandInitShardPrimary,
}
Expand Down
1 change: 0 additions & 1 deletion go/flags/endtoend/vtctldclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Available Commands:
GetTopologyPath Gets the file located at the specified path in the topology server.
GetVSchema Prints a JSON representation of a keyspace's topo record.
GetWorkflows Gets all vreplication workflows (Reshard, MoveTables, etc) in the given keyspace.
InitShardPrimary Sets the initial primary for the shard.
LegacyVtctlCommand Invoke a legacy vtctlclient command. Flag parsing is best effort.
PingTablet Checks that the specified tablet is awake and responding to RPCs. This command can be blocked by other in-flight operations.
PlannedReparentShard Reparents the shard to a new primary, or away from an old primary. Both the old and new primaries must be up and running.
Expand Down
10 changes: 6 additions & 4 deletions go/vt/vtctl/reparent.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ func init() {
help: "Reparent a tablet to the current primary in the shard. This only works if the current replication position matches the last known reparent action.",
})
addCommand("Shards", command{
name: "InitShardPrimary",
method: commandInitShardPrimary,
params: "[--force] [--wait_replicas_timeout=<duration>] <keyspace/shard> <tablet alias>",
help: "Sets the initial primary for a shard. Will make all other tablets in the shard replicas of the provided tablet. WARNING: this could cause data loss on an already replicating shard. PlannedReparentShard or EmergencyReparentShard should be used instead.",
name: "InitShardPrimary",
method: commandInitShardPrimary,
params: "[--force] [--wait_replicas_timeout=<duration>] <keyspace/shard> <tablet alias>",
help: "Sets the initial primary for a shard. Will make all other tablets in the shard replicas of the provided tablet. WARNING: this could cause data loss on an already replicating shard. PlannedReparentShard or EmergencyReparentShard should be used instead.",
deprecated: true,
deprecatedBy: "PlannedReparentShard",
})
addCommand("Shards", command{
name: "PlannedReparentShard",
Expand Down

0 comments on commit 6b2208b

Please sign in to comment.