Skip to content

go/vt/mysqlctl: run backup init sql after catchup, disable super read… #8815

go/vt/mysqlctl: run backup init sql after catchup, disable super read…

go/vt/mysqlctl: run backup init sql after catchup, disable super read… #8815

name: Query Serving (Queries - 2) - Upgrade Downgrade Testing
on:
push:
branches:
- "main"
- "release-[0-9]+.[0-9]"
tags: '**'
pull_request:
branches: '**'
concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Query Serving (Queries - 2)')
cancel-in-progress: true
permissions: read-all
# This test ensures that our end-to-end tests work using Vitess components
# (vtgate, vttablet, etc) built on different versions.
jobs:
upgrade_downgrade_test:
timeout-minutes: 60
name: Run Upgrade Downgrade Test - Query Serving (Queries - 2)
runs-on: oracle-vm-16cpu-64gb-x86-64
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Skip CI
run: |
if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
echo "skipping CI due to the 'Skip CI' label"
exit 1
fi
- name: Check out commit's code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: 'false'
- name: Check for changes in relevant files
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: changes
with:
token: ''
filters: |
end_to_end:
- 'test/config.json'
- 'go/**'
- 'go/**/*.go'
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.sum'
- 'go.mod'
- 'proto/*.proto'
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/upgrade_downgrade_test_query_serving_queries.yml'
- name: Set output with latest release branch
if: steps.changes.outputs.end_to_end == 'true'
id: output-previous-release-ref
run: |
previous_release_ref=$(./tools/get_previous_release.sh ${{github.base_ref}} ${{github.ref}})
echo $previous_release_ref
echo "previous_release_ref=${previous_release_ref}" >> $GITHUB_OUTPUT
- name: Tune the OS
if: steps.changes.outputs.end_to_end == 'true'
uses: ./.github/actions/tune-os
- name: Set up python
if: steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- name: Setup MySQL
if: steps.changes.outputs.end_to_end == 'true'
uses: ./.github/actions/setup-mysql
with:
flavor: mysql-8.4
- name: Get base dependencies
timeout-minutes: 10
if: steps.changes.outputs.end_to_end == 'true'
run: |
sudo DEBIAN_FRONTEND="noninteractive" apt-get update
# Install everything else we need, and configure
sudo apt-get install -y make unzip g++ etcd-client etcd-server curl git wget
sudo service etcd stop
# Build current commit's binaries
- name: Get dependencies for this commit
if: steps.changes.outputs.end_to_end == 'true'
run: |
go mod download
- name: Building the binaries for this commit
if: steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |
source build.env
NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
rm -Rf bin/*
# Checkout to the last release of Vitess
- name: Check out other version's code (${{ steps.output-previous-release-ref.outputs.previous_release_ref }})
if: steps.changes.outputs.end_to_end == 'true'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
persist-credentials: 'false'
- name: Set up Go
if: steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
cache: false
- name: Get dependencies for the last release
if: steps.changes.outputs.end_to_end == 'true'
run: |
go mod download
- name: Building last release's binaries
if: steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |
source build.env
NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
- name: Convert ErrorContains checks to Error checks
if: steps.changes.outputs.end_to_end == 'true'
run: |
find ./go/test/endtoend -name '*.go' -exec sed -i 's/ErrorContains/Error/g' {} +
find ./go/test/endtoend -name '*.go' -exec sed -i 's/EqualError/Error/g' {} +
# Swap the binaries in the bin. Use vtgate version n-1 and keep vttablet at version n
- name: Use last release's VTGate
if: steps.changes.outputs.end_to_end == 'true'
run: |
source build.env
cp -r /tmp/vitess-build-current/bin/* $PWD/bin/
rm -f $PWD/bin/vtgate
cp /tmp/vitess-build-other/bin/vtgate $PWD/bin/vtgate
vtgate --version
# Running a test with vtgate at version n-1 and vttablet/vtctld at version n
- name: Run query serving tests (vtgate=N-1, vttablet=N, vtctld=N)
if: steps.changes.outputs.end_to_end == 'true'
run: |
rm -rf /tmp/vtdataroot
mkdir -p /tmp/vtdataroot
source build.env
go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_query_serving_queries_2
# Swap the binaries again. This time, vtgate will be at version n, and vttablet/vtctld will be at version n-1
- name: Use current version VTGate, and other version VTTablet/VTctld
if: steps.changes.outputs.end_to_end == 'true'
run: |
source build.env
rm -f $PWD/bin/vtgate $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-current/bin/vtgate $PWD/bin/vtgate
cp /tmp/vitess-build-other/bin/vtctld $PWD/bin
cp /tmp/vitess-build-other/bin/vtctldclient $PWD/bin
cp /tmp/vitess-build-other/bin/vtctl $PWD/bin
cp /tmp/vitess-build-other/bin/vtctlclient $PWD/bin
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vtgate --version
vttablet --version
# Running a test with vtgate at version n and vttablet/vtctld at version n-1
- name: Run query serving tests (vtgate=N, vttablet=N-1, vtctld=N-1)
if: steps.changes.outputs.end_to_end == 'true'
run: |
rm -rf /tmp/vtdataroot
mkdir -p /tmp/vtdataroot
source build.env
go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_query_serving_queries_2