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: remove cockroach quit #82988

Merged
merged 7 commits into from
Jun 17, 2022
Merged

cli: remove cockroach quit #82988

merged 7 commits into from
Jun 17, 2022

Conversation

knz
Copy link
Contributor

@knz knz commented Jun 16, 2022

As per cockroachdb/docs#14299.

Release note (backward-incompatible change): The cockroach quit
command was removed. It had been deprecated since v20.1. To shut down
a node gracefully, send a SIGTERM signal to it.

cc @taroface

@knz knz requested review from erikgrinaker and tbg June 16, 2022 13:09
@knz knz requested review from a team as code owners June 16, 2022 13:09
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz knz force-pushed the 20220616-quit branch 2 times, most recently from 7c804b1 to fe0792a Compare June 16, 2022 13:28
@erikgrinaker
Copy link
Contributor

Unsure if this needs to be documented - is roachprod public-facing?

No, roachprod isn't public-facing, so we can skip the release note.

@srosenberg
Copy link
Member

Unsure if this needs to be documented - is roachprod public-facing?

No, roachprod isn't public-facing, so we can skip the release note.

Technically it is; e.g., cloud report playbook uses it.

Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM at a high level.

@@ -19,7 +19,7 @@ To interact with a one-node SQL cluster:

$ cockroach start --background --insecure
$ cockroach sql --insecure
$ cockroach quit --insecure
$ killall -TERM cockroach # to shut down the nodes
Copy link
Contributor

@erikgrinaker erikgrinaker Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to note here is that on some Unices (looking at you Solaris), killall will kill all processes on the system. Maybe that's obscure enough that we don't have to worry about it, given that we only officially support Linux and macOS does something similar here. But worth keeping in mind if we're going to sprinkle this all over our docs etc.

Then again, if some people do run those Unices, I guess they're already aware.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, Erik! Personally, I never run killall. In this case, I'd probably use pgrep cockroach | xargs kill -TERM, but I am also fine with killall being in README.

@erikgrinaker
Copy link
Contributor

erikgrinaker commented Jun 16, 2022

Unsure if this needs to be documented - is roachprod public-facing?

No, roachprod isn't public-facing, so we can skip the release note.

Technically it is; e.g., cloud report playbook uses it.

Doesn't it make certain assumptions about our cloud setup though, e.g. project names and VM names and stuff? Seems like more trouble than it's worth to officially support it.

It's called out in the README too:

roachprod is an internal tool for creating and testing CockroachDB clusters. Use at your own risk!

@knz
Copy link
Contributor Author

knz commented Jun 16, 2022

I'll remove the release note. (After the other changes that CI will tell me to make.)

@@ -9,7 +9,7 @@
set -euo pipefail

apt-get update
apt-get install -y autoconf bison cmake libncurses-dev
apt-get install -y autoconf bison cmake libncurses-dev psmisc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that's for killall? Maybe we could do away by using pgrep cockroach | kill -TERM instead?

@@ -962,32 +962,33 @@ func TestClientConnSettings(t *testing.T) {

// For some reason, when run under stress all these test cases fail due to the
// `--host` flag being unknown to quitCmd. Just skip this under stress.
// TODO(knz): Check if this skip still applies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to lift the skip if this no longer holds.

knz added 5 commits June 16, 2022 18:00
As of v20.1, the recommended way to shut down a node is to
send SIGTERM, then wait for the process to gracefully terminate,
then *only if it doesn't terminate within a reasonable delay* follow
up with SIGKILL.
The command `cockroach quit` was deprecated.

In order to enable graceful shutdown tests, we thus need a new
mechanism in `roachprod` to "send a signal then wait a reasonable
amount of time until the process terminates".

This patch introduces this via the new command-line flag `--max-wait`.

Release note: None
Copy link
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker, @srosenberg, and @tbg)


build/verify-archive.sh line 12 at r7 (raw file):

Previously, srosenberg (Stan Rosenberg) wrote…

I assume that's for killall? Maybe we could do away by using pgrep cockroach | kill -TERM instead?

pgrep is part of procps which needs to be installed to. Changed to use that instead.


build/archive/contents/README line 22 at r6 (raw file):

Previously, srosenberg (Stan Rosenberg) wrote…

Good point, Erik! Personally, I never run killall. In this case, I'd probably use pgrep cockroach | xargs kill -TERM, but I am also fine with killall being in README.

Changed to pkill.


pkg/cli/flags_test.go line 965 at r7 (raw file):

Previously, srosenberg (Stan Rosenberg) wrote…

Would be nice to lift the skip if this no longer holds.

I agree. But I don't think this should hold this PR.

@knz knz requested a review from a team June 16, 2022 17:03
@knz
Copy link
Contributor Author

knz commented Jun 16, 2022

bors r=erikgrinaker,srosenberg

@craig
Copy link
Contributor

craig bot commented Jun 16, 2022

Build failed (retrying...):

@knz
Copy link
Contributor Author

knz commented Jun 16, 2022

@tbg points out this might be flaky. Will investigate further.

bors r-

@craig
Copy link
Contributor

craig bot commented Jun 16, 2022

Canceled.

knz added 2 commits June 16, 2022 21:53
Release note (backward-incompatible change): The `cockroach quit`
command was removed. It had been deprecated since v20.1. To shut down
a node gracefully, send a SIGTERM signal to it.
@knz
Copy link
Contributor Author

knz commented Jun 16, 2022

bors r=erikgrinaker,srosenberg

@craig craig bot merged commit 8f23486 into cockroachdb:master Jun 17, 2022
@craig
Copy link
Contributor

craig bot commented Jun 17, 2022

Build succeeded:

@knz knz deleted the 20220616-quit branch June 17, 2022 07:51
craig bot pushed a commit that referenced this pull request Oct 7, 2022
89526: bincheck: work around deprecated `cockroach quit` r=matthewtodd a=matthewtodd

The `cockroach quit` subcommand has been [removed][1]. The recommended way to issue a graceful shutdown is sending a `SIGTERM` signal.

[1]: #82988

Release note: None

Co-authored-by: Matthew Todd <todd@cockroachlabs.com>
blathers-crl bot pushed a commit that referenced this pull request Oct 11, 2022
The `cockroach quit` subcommand has been removed[1]. The recommended way
to issue a graceful shutdown is sending a `SIGTERM` signal.

[1]: #82988

Release note: None
blathers-crl bot pushed a commit that referenced this pull request Oct 11, 2022
The `cockroach quit` subcommand has been removed[1]. The recommended way
to issue a graceful shutdown is sending a `SIGTERM` signal.

[1]: #82988

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants