vttablet-up and vtgate-up to block until ready

shellcheck is temporarily disabled due to https://github.com/vitessio/vitess/issues/5305

No new shellcheck issues should be introduced, but there are existing
problems with vtgate-up.sh and vttablet-up.sh which are not addressed.

Signed-off-by: Morgan Tocker <tocker@gmail.com>
This commit is contained in:
Morgan Tocker 2019-10-25 11:34:20 -06:00
Родитель ec34ce1515
Коммит bfcf8a6951
5 изменённых файлов: 25 добавлений и 3 удалений

Просмотреть файл

@ -34,7 +34,6 @@ CELL=zone1 "$script_root/vtctld-up.sh"
# start vttablets for keyspace commerce
CELL=zone1 KEYSPACE=commerce UID_BASE=100 "$script_root/vttablet-up.sh"
sleep 15
# set one of the replicas to master
./lvtctl.sh InitShardMaster -force commerce/0 zone1-100

Просмотреть файл

@ -24,7 +24,7 @@ set -e
script_root=$(dirname "${BASH_SOURCE}")
CELL=zone1 KEYSPACE=customer UID_BASE=200 "$script_root/vttablet-up.sh"
sleep 15
./lvtctl.sh InitShardMaster -force customer/0 zone1-200
./lvtctl.sh CopySchemaShard -tables customer,corder commerce/0 customer/0
./lvtctl.sh ApplyVSchema -vschema_file vschema_commerce_vsplit.json commerce

Просмотреть файл

@ -24,7 +24,7 @@ script_root=$(dirname "${BASH_SOURCE}")
SHARD=-80 CELL=zone1 KEYSPACE=customer UID_BASE=300 "$script_root/vttablet-up.sh"
SHARD=80- CELL=zone1 KEYSPACE=customer UID_BASE=400 "$script_root/vttablet-up.sh"
sleep 15
./lvtctl.sh InitShardMaster -force customer/-80 zone1-300
./lvtctl.sh InitShardMaster -force customer/80- zone1-400
./lvtctl.sh CopySchemaShard customer/0 customer/-80

Просмотреть файл

@ -89,6 +89,16 @@ $VTROOT/bin/vtgate \
$optional_tls_args \
> $VTDATAROOT/tmp/vtgate.out 2>&1 &
# Block waiting for vtgate to be listening
# Not the same as healthy
echo "Waiting for vtgate to be up..."
while true; do
curl -I "http://$hostname:$web_port/debug/status" >/dev/null 2>&1 && break
sleep 0.1
done;
echo "vtgate is up!"
echo "Access vtgate at http://$hostname:$web_port/debug/status"
disown -a

Просмотреть файл

@ -129,4 +129,17 @@ for uid_index in $uids; do
echo "Access tablet $alias at http://$hostname:$port/debug/status"
done
# Block waiting for all tablets to be listening
# Not the same as healthy
echo "Waiting for tablets to be listening..."
for uid_index in $uids; do
port=$[$port_base + $uid_index]
while true; do
curl -I "http://$hostname:$port/debug/status" >/dev/null 2>&1 && break
sleep 0.1
done;
done;
echo "Tablets up!"
disown -a