vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.19k stars 2.06k forks source link

Bug Report: vtadmin stopping error running Vitess 17 401_teardown.sh (Local Install) if 101_initial_cluster.sh is run with SKIP_VTADMIN="yes". #13432

Closed jfg956 closed 1 year ago

jfg956 commented 1 year ago

Overview of the Issue

I am running the Vitess 17 Local installed as described in {1} and using SKIP_VTADMIN="yes" (undocumented, but very interesting feature that I gathered from {2}: I ran SKIP_VTADMIN="yes" ./101_initial_cluster.sh).

{1}: https://vitess.io/docs/17.0/get-started/local/ {2}: https://github.com/vitessio/vitess/blob/f47c60607286b7591e505b6227db263129a7cae8/examples/local/101_initial_cluster.sh#L77

But when I run 401_teardown.sh I get error messages related to vtadmin, see Reproduction Steps for details.

I think the fix is simple: test for file existence in {3}, I will probably submit a PR implementing this.

{3}: https://github.com/vitessio/vitess/blob/f47c60607286b7591e505b6227db263129a7cae8/examples/common/scripts/vtadmin-down.sh

Thanks for looking into this, Jean-François Gagné

Reproduction Steps

$ ./401_teardown.sh Stopping vtadmin-web... cat: /home/jgagne/my-vitess-example/examples/local/vtdataroot/tmp/vtadmin-web.pid: No such file or directory ../common/scripts/vtadmin-down.sh: line 6: kill: ': not a pid or valid job spec Stopping vtadmin-api... cat: /home/jgagne/my-vitess-example/examples/local/vtdataroot/tmp/vtadmin-api.pid: No such file or directory ../common/scripts/vtadmin-down.sh: line 9: kill:': not a pid or valid job spec Stopping vtorc. Stopping vtgate... Shutting down tablet zone1-0000000100 Shutting down MySQL for tablet zone1-0000000100... Shutting down tablet zone1-0000000101 Shutting down MySQL for tablet zone1-0000000101... Shutting down tablet zone1-0000000102 Shutting down MySQL for tablet zone1-0000000102... Stopping vtctld... Stopping etcd... All good! It looks like every process has shut down

Binary Version

$ vtgate --version
Version: 17.0.0 (Git revision 70a94669826071e31f4ac14047de911753f4af5d branch 'HEAD') built on Tue Jun 27 13:20:18 UTC 2023 by runner@fv-az1098-397 using go1.20.5 linux/amd64

Operating System and Environment details

# I do not thhink this is relevant, but as requested...

$ cat /etc/os-release
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"

$ uname -sr
Linux 5.15.73-hs31.el8.x86_64

$ uname -m
x86_64

Log Fragments

No response

jfg956 commented 1 year ago

Similar errors happen for other components if they are not running, but as there are no explicit options for not running these, I am letting these fixes for someone else (below while I was testing my patch).

$ ./401_teardown.sh
Skipping stopping vtadmin-web because no pid file.
Skipping stopping vtadmin-api because no pid file.
Stopping vtorc.
cat: /home/jgagne/my-vitess-example/examples/local/vtdataroot/tmp/vtorc.pid: No such file or directory
../common/scripts/vtorc-down.sh: line 6: kill: `': not a pid or valid job spec
Stopping vtgate...
cat: /home/jgagne/my-vitess-example/examples/local/vtdataroot/tmp/vtgate.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Stopping vtctld...
cat: /home/jgagne/my-vitess-example/examples/local/vtdataroot/tmp/vtctld.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Stopping etcd...
cat: /home/jgagne/my-vitess-example/examples/local/vtdataroot/tmp/etcd.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
All good! It looks like every process has shut down
jfg956 commented 1 year ago

Fix in below PR. https://github.com/vitessio/vitess/pull/13433