Skip to content

Commit

Permalink
fix upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjinx committed Jan 18, 2025
1 parent eba5510 commit b43f958
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/upgrade_downgrade_test_backups_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 5
run: |
source build.env ; cd examples/local/backups
./upgrade_cluster.sh
source build.env ; cd examples/local
./backups/upgrade_cluster.sh
# We count the number of rows in every table to check that the restore step was successful.
- name: Assert the number of rows in every table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 5
run: |
source build.env ; cd examples/local/backups
./upgrade_cluster.sh
source build.env ; cd examples/local
./backups/upgrade_cluster.sh
# We count the number of rows in every table to check that the restore step was successful.
- name: Assert the number of rows in every table
Expand Down
38 changes: 19 additions & 19 deletions examples/local/backups/upgrade_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,46 @@
# this script brings up new tablets for the two new shards that we will
# be creating in the customer keyspace and copies the schema

source ../env.sh
source ./env.sh

# Restart the replica tablets so that they come up with new vttablet versions
for i in 101 102; do
echo "Shutting down tablet zone1-$i"
CELL=zone1 TABLET_UID=$i ../scripts/vttablet-down.sh
CELL=zone1 TABLET_UID=$i ./scripts/vttablet-down.sh
echo "Shutting down mysql zone1-$i"
CELL=zone1 TABLET_UID=$i ../scripts/mysqlctl-down.sh
CELL=zone1 TABLET_UID=$i ./scripts/mysqlctl-down.sh
echo "Removing tablet directory zone1-$i"
vtctlclient DeleteTablet -- --allow_primary=true zone1-$i
rm -Rf $VTDATAROOT/vt_0000000$i
echo "Starting tablet zone1-$i again"
CELL=zone1 TABLET_UID=$i ../scripts/mysqlctl-up.sh
CELL=zone1 KEYSPACE=commerce TABLET_UID=$i ../scripts/vttablet-up.sh
CELL=zone1 TABLET_UID=$i ./scripts/mysqlctl-up.sh
CELL=zone1 KEYSPACE=commerce TABLET_UID=$i ./scripts/vttablet-up.sh
done

for i in 201 202; do
echo "Shutting down tablet zone1-$i"
CELL=zone1 TABLET_UID=$i ../scripts/vttablet-down.sh
CELL=zone1 TABLET_UID=$i ./scripts/vttablet-down.sh
echo "Shutting down mysql zone1-$i"
CELL=zone1 TABLET_UID=$i ../scripts/mysqlctl-down.sh
CELL=zone1 TABLET_UID=$i ./scripts/mysqlctl-down.sh
echo "Removing tablet directory zone1-$i"
vtctlclient DeleteTablet -- --allow_primary=true zone1-$i
rm -Rf $VTDATAROOT/vt_0000000$i
echo "Starting tablet zone1-$i again"
CELL=zone1 TABLET_UID=$i ../scripts/mysqlctl-up.sh
SHARD=-80 CELL=zone1 KEYSPACE=customer TABLET_UID=$i ../scripts/vttablet-up.sh
CELL=zone1 TABLET_UID=$i ./scripts/mysqlctl-up.sh
SHARD=-80 CELL=zone1 KEYSPACE=customer TABLET_UID=$i ./scripts/vttablet-up.sh
done

for i in 301 302; do
echo "Shutting down tablet zone1-$i"
CELL=zone1 TABLET_UID=$i ../scripts/vttablet-down.sh
CELL=zone1 TABLET_UID=$i ./scripts/vttablet-down.sh
echo "Shutting down mysql zone1-$i"
CELL=zone1 TABLET_UID=$i ../scripts/mysqlctl-down.sh
CELL=zone1 TABLET_UID=$i ./scripts/mysqlctl-down.sh
echo "Removing tablet directory zone1-$i"
vtctlclient DeleteTablet -- --allow_primary=true zone1-$i
rm -Rf $VTDATAROOT/vt_0000000$i
echo "Starting tablet zone1-$i again"
CELL=zone1 TABLET_UID=$i ../scripts/mysqlctl-up.sh
SHARD=80- CELL=zone1 KEYSPACE=customer TABLET_UID=$i ../scripts/vttablet-up.sh
CELL=zone1 TABLET_UID=$i ./scripts/mysqlctl-up.sh
SHARD=80- CELL=zone1 KEYSPACE=customer TABLET_UID=$i ./scripts/vttablet-up.sh
done

# Wait for all the replica tablets to be in the serving state before reparenting to them.
Expand Down Expand Up @@ -85,13 +85,13 @@ vtctldclient PlannedReparentShard customer/80- --new-primary "zone1-301"

# Restart the old primary tablets so that they are on the latest version of vttablet too.
echo "Restarting tablet zone1-100"
CELL=zone1 TABLET_UID=100 ../scripts/vttablet-down.sh
CELL=zone1 KEYSPACE=commerce TABLET_UID=100 ../scripts/vttablet-up.sh
CELL=zone1 TABLET_UID=100 ./scripts/vttablet-down.sh
CELL=zone1 KEYSPACE=commerce TABLET_UID=100 ./scripts/vttablet-up.sh

echo "Restarting tablet zone1-200"
CELL=zone1 TABLET_UID=200 ../scripts/vttablet-down.sh
SHARD=-80 CELL=zone1 KEYSPACE=customer TABLET_UID=200 ../scripts/vttablet-up.sh
CELL=zone1 TABLET_UID=200 ./scripts/vttablet-down.sh
SHARD=-80 CELL=zone1 KEYSPACE=customer TABLET_UID=200 ./scripts/vttablet-up.sh

echo "Restarting tablet zone1-300"
CELL=zone1 TABLET_UID=300 ../scripts/vttablet-down.sh
SHARD=80- CELL=zone1 KEYSPACE=customer TABLET_UID=300 ../scripts/vttablet-up.sh
CELL=zone1 TABLET_UID=300 ./scripts/vttablet-down.sh
SHARD=80- CELL=zone1 KEYSPACE=customer TABLET_UID=300 ./scripts/vttablet-up.sh

0 comments on commit b43f958

Please sign in to comment.