Skip to content
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

cli: delete cockroach quit --decommission #49350

Merged
merged 1 commit into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions pkg/cli/cliflags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,11 +915,6 @@ If specified, print the system config contents. Beware that the output will be
long and not particularly human-readable.`,
}

Decommission = FlagInfo{
Name: "decommission",
Description: `Deprecated: use 'node decommission' instead.`,
}

DrainWait = FlagInfo{
Name: "drain-wait",
Description: `
Expand Down
4 changes: 0 additions & 4 deletions pkg/cli/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ func initCLIDefaults() {
startCtx.inBackground = false
startCtx.geoLibsDir = "/usr/local/lib"

quitCtx.serverDecommission = false
quitCtx.drainWait = 10 * time.Minute

nodeCtx.nodeDecommissionWait = nodeDecommissionWaitAll
Expand Down Expand Up @@ -353,9 +352,6 @@ var startCtx struct {
// `node drain` commands.
// Defaults set by InitCLIDefaults() above.
var quitCtx struct {
// serverDecommission indicates the server should be decommissioned
// before it is drained.
serverDecommission bool
// drainWait is the amount of time to wait for the server
// to drain. Set to 0 to disable a timeout (let the server decide).
drainWait time.Duration
Expand Down
13 changes: 1 addition & 12 deletions pkg/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,18 +567,7 @@ func init() {
// Decommission command.
VarFlag(decommissionNodeCmd.Flags(), &nodeCtx.nodeDecommissionWait, cliflags.Wait)

// Quit command.
{
f := quitCmd.Flags()
// The --decommission flag for quit is now deprecated.
// Users should use `node decommission` and then `quit` after
// decommission completes.
// TODO(knz): Remove in 20.2.
BoolFlag(f, &quitCtx.serverDecommission, cliflags.Decommission, quitCtx.serverDecommission)
_ = f.MarkDeprecated(cliflags.Decommission.Name, `use 'cockroach node decommission' then 'cockroach quit' instead`)
}

// Quit and node drain.
// Quit and node drain commands.
for _, cmd := range []*cobra.Command{quitCmd, drainNodeCmd} {
f := cmd.Flags()
DurationFlag(f, &quitCtx.drainWait, cliflags.DrainWait, quitCtx.drainWait)
Expand Down
14 changes: 0 additions & 14 deletions pkg/cli/quit.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"strings"
"time"

"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/server"
"github.com/cockroachdb/cockroach/pkg/server/serverpb"
"github.com/cockroachdb/cockroach/pkg/util/contextutil"
Expand Down Expand Up @@ -67,19 +66,6 @@ func runQuit(cmd *cobra.Command, args []string) (err error) {
}
defer finish()

// If --decommission was passed, perform the decommission as first
// step. (Note that this flag is deprecated. It will be removed.)
if quitCtx.serverDecommission {
var myself []roachpb.NodeID // will remain empty, which means target yourself
if err := runDecommissionNodeImpl(ctx, c, nodeDecommissionWaitAll, myself); err != nil {
log.Warningf(ctx, "%v", err)
if server.IsWaitingForInit(err) {
err = errors.New("node cannot be decommissioned before it has been initialized")
}
return err
}
}

return drainAndShutdown(ctx, c)
}

Expand Down