Skip to content

Commit

Permalink
Revert "[release-19.0] Improve the queries upgrade/downgrade CI workf…
Browse files Browse the repository at this point in the history
…low by using same test code version as binary (vitessio#16494) (vitessio#16501)"

This reverts commit 25a80ac.
  • Loading branch information
timvaillancourt committed Sep 24, 2024
1 parent fbfe148 commit 8cd6da2
Show file tree
Hide file tree
Showing 24 changed files with 268 additions and 125 deletions.
75 changes: 33 additions & 42 deletions .github/workflows/upgrade_downgrade_test_query_serving_queries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,63 +121,70 @@ jobs:
# install JUnit report formatter
go install github.com/vitessio/go-junit-report@HEAD
# Build current commit's binaries
- name: Get dependencies for this commit
# 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.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/checkout@v4
with:
ref: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}

- name: Get dependencies for the last release
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
go mod download
- name: Building the binaries for this commit
- name: Building last release's binaries
if: steps.skip-workflow.outputs.skip-workflow == 'false' && 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/
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
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 }})
# Checkout to this build's commit
- name: Check out commit's code
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/checkout@v4
with:
ref: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}

- name: Get dependencies for the last release
- name: Get dependencies for this commit
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
go mod download
- name: Building last release's binaries
- name: Building the binaries for this commit
if: steps.skip-workflow.outputs.skip-workflow == 'false' && 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/*
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
- name: Convert ErrorContains checks to Error checks
# Running a test with vtgate and vttablet using version n
- name: Run query serving tests (vtgate=N, vttablet=N)
if: steps.skip-workflow.outputs.skip-workflow == 'false' && 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' {} +
rm -rf /tmp/vtdataroot
mkdir -p /tmp/vtdataroot
source build.env
eatmydata -- go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_query_serving_queries
>>>>>>> parent of 25a80acbfd ([release-19.0] Improve the queries upgrade/downgrade CI workflow by using same test code version as binary (#16494) (#16501))

# 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.skip-workflow.outputs.skip-workflow == 'false' && 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)
# Running a test with vtgate at version n-1 and vttablet at version n
- name: Run query serving tests (vtgate=N-1, vttablet=N)
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
rm -rf /tmp/vtdataroot
Expand All @@ -186,38 +193,22 @@ jobs:
source build.env
eatmydata -- go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_query_serving_queries
- name: Check out commit's code
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/checkout@v4
with:
fetch-depth: 0

# 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
# Swap the binaries again. This time, vtgate will be at version n, and vttablet will be at version n-1
- name: Use current version VTGate, and other version VTTablet
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
source build.env
rm -Rf bin/*
cp -r /tmp/vitess-build-current/bin/* $PWD/bin/
rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
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/vttablet $PWD/bin/vttablet
cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
cp /tmp/vitess-build-other/bin/vtctld $PWD/bin/vtctld
cp /tmp/vitess-build-other/bin/vtctldclient $PWD/bin/vtctldclient
cp /tmp/vitess-build-other/bin/vtctl $PWD/bin/vtctl
cp /tmp/vitess-build-other/bin/vtctlclient $PWD/bin/vtctlclient
vtgate --version
vttablet --version
vtctl --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)
# Running a test with vtgate at version n and vttablet at version n-1
- name: Run query serving tests (vtgate=N, vttablet=N-1)
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
rm -rf /tmp/vtdataroot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,57 +115,64 @@ jobs:
# install JUnit report formatter
go install github.com/vitessio/go-junit-report@HEAD
# Build current commit's binaries
- name: Get dependencies for this commit
# Checkout to the next release of Vitess
- name: Check out other version's code (${{ steps.output-next-release-ref.outputs.next_release_ref }})
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/checkout@v4
with:
ref: ${{ steps.output-next-release-ref.outputs.next_release_ref }}

- name: Get dependencies for the next release
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
go mod download
- name: Building the binaries for this commit
- name: Building next release's binaries
if: steps.skip-workflow.outputs.skip-workflow == 'false' && 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/
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
# Checkout to the next release of Vitess
- name: Check out other version's code (${{ steps.output-next-release-ref.outputs.next_release_ref }})
# Checkout to this build's commit
- name: Check out commit's code
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/checkout@v4
with:
ref: ${{ steps.output-next-release-ref.outputs.next_release_ref }}

- name: Get dependencies for the next release
- name: Get dependencies for this commit
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
go mod download
- name: Building next release's binaries
- name: Building the binaries for this commit
if: steps.skip-workflow.outputs.skip-workflow == 'false' && 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/*
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
- name: Convert ErrorContains checks to Error checks
# Running a test with vtgate and vttablet using version n
- name: Run query serving tests (vtgate=N, vttablet=N)
if: steps.skip-workflow.outputs.skip-workflow == 'false' && 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' {} +
rm -rf /tmp/vtdataroot
mkdir -p /tmp/vtdataroot
source build.env
eatmydata -- go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_query_serving_queries
>>>>>>> parent of 25a80acbfd ([release-19.0] Improve the queries upgrade/downgrade CI workflow by using same test code version as binary (#16494) (#16501))

# Swap the binaries in the bin. Use vtgate version n+1 and keep vttablet at version n
- name: Use next release's VTGate
if: steps.skip-workflow.outputs.skip-workflow == 'false' && 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
Expand All @@ -180,38 +187,28 @@ jobs:
source build.env
eatmydata -- go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_query_serving_queries
- name: Check out commit's code
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
uses: actions/checkout@v4
with:
fetch-depth: 0

# Swap the binaries again. This time, vtgate will be at version n, and vttablet will be at version n+1
- name: Use current version VTGate, and other version VTTablet/VTctld
- name: Use current version VTGate, and other version VTTablet
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
source build.env
rm -Rf bin/*
cp -r /tmp/vitess-build-current/bin/* $PWD/bin/
rm -f $PWD/bin/vtgate $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-current/bin/vtgate $PWD/bin/vtgate
rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
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
cp /tmp/vitess-build-other/bin/vtctld $PWD/bin/vtctld
cp /tmp/vitess-build-other/bin/vtctldclient $PWD/bin/vtctldclient
cp /tmp/vitess-build-other/bin/vtctl $PWD/bin/vtctl
cp /tmp/vitess-build-other/bin/vtctlclient $PWD/bin/vtctlclient
vtgate --version
vttablet --version
vtctl --version
# Running a test with vtgate at version n and vttablet at version n+1
- name: Run query serving tests (vtgate=N, vttablet=N+1, vtctld=N+1)
- name: Run query serving tests (vtgate=N, vttablet=N+1)
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
rm -rf /tmp/vtdataroot
Expand Down
15 changes: 10 additions & 5 deletions go/test/endtoend/backup/vtbackup/backup_only_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,15 @@ func TestTabletInitialBackup(t *testing.T) {
// Initialize the tablets
initTablets(t, false, false)

err := primary.VttabletProcess.CreateDB("testDB")
require.ErrorContains(t, err, "The MySQL server is running with the --super-read-only option so it cannot execute this statement")
err = replica1.VttabletProcess.CreateDB("testDB")
require.ErrorContains(t, err, "The MySQL server is running with the --super-read-only option so it cannot execute this statement")
vtTabletVersion, err := cluster.GetMajorVersion("vttablet")
require.NoError(t, err)
// For all version at or above v17.0.0, each replica will start in super_read_only mode. Let's verify that is working correctly.
if vtTabletVersion >= 17 {
err := primary.VttabletProcess.CreateDB("testDB")
require.ErrorContains(t, err, "The MySQL server is running with the --super-read-only option so it cannot execute this statement")
err = replica1.VttabletProcess.CreateDB("testDB")
require.ErrorContains(t, err, "The MySQL server is running with the --super-read-only option so it cannot execute this statement")
}

// Restore the Tablet
restore(t, primary, "replica", "NOT_SERVING")
Expand Down Expand Up @@ -167,7 +172,7 @@ func firstBackupTest(t *testing.T, tabletType string) {
restore(t, replica2, "replica", "SERVING")
// Replica2 takes time to serve. Sleeping for 5 sec.
time.Sleep(5 * time.Second)
// check the new replica has the data
//check the new replica has the data
cluster.VerifyRowsInTablet(t, replica2, keyspaceName, 2)

removeBackups(t)
Expand Down
9 changes: 7 additions & 2 deletions go/test/endtoend/cluster/vtctld_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ func (vtctld *VtctldProcess) Setup(cell string, extraArgs ...string) (err error)
"--log_dir", vtctld.LogDir,
"--port", fmt.Sprintf("%d", vtctld.Port),
"--grpc_port", fmt.Sprintf("%d", vtctld.GrpcPort),
"--bind-address", "127.0.0.1",
"--grpc_bind_address", "127.0.0.1",
)

if v, err := GetMajorVersion("vtctld"); err != nil {
return err
} else if v >= 18 {
vtctld.proc.Args = append(vtctld.proc.Args, "--bind-address", "127.0.0.1")
vtctld.proc.Args = append(vtctld.proc.Args, "--grpc_bind_address", "127.0.0.1")
}

if *isCoverage {
vtctld.proc.Args = append(vtctld.proc.Args, "--test.coverprofile="+getCoveragePath("vtctld.out"))
}
Expand Down
8 changes: 6 additions & 2 deletions go/test/endtoend/cluster/vtgate_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ func (vtgate *VtgateProcess) Setup() (err error) {
"--tablet_types_to_wait", vtgate.TabletTypesToWait,
"--service_map", vtgate.ServiceMap,
"--mysql_auth_server_impl", vtgate.MySQLAuthServerImpl,
"--bind-address", "127.0.0.1",
"--grpc_bind_address", "127.0.0.1",
}
if v, err := GetMajorVersion("vtgate"); err != nil {
return err
} else if v >= 18 {
args = append(args, "--bind-address", "127.0.0.1")
args = append(args, "--grpc_bind_address", "127.0.0.1")
}
// If no explicit mysql_server_version has been specified then we autodetect
// the MySQL version that will be used for the test and base the vtgate's
Expand Down
7 changes: 6 additions & 1 deletion go/test/endtoend/cluster/vtorc_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,14 @@ func (orc *VTOrcProcess) Setup() (err error) {
"--instance-poll-time", "1s",
// Faster topo information refresh speeds up the tests. This doesn't add any significant load either
"--topo-information-refresh-duration", "3s",
"--bind-address", "127.0.0.1",
)

if v, err := GetMajorVersion("vtorc"); err != nil {
return err
} else if v >= 18 {
orc.proc.Args = append(orc.proc.Args, "--bind-address", "127.0.0.1")
}

if *isCoverage {
orc.proc.Args = append(orc.proc.Args, "--test.coverprofile="+getCoveragePath("orc.out"))
}
Expand Down
8 changes: 6 additions & 2 deletions go/test/endtoend/cluster/vttablet_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ func (vttablet *VttabletProcess) Setup() (err error) {
"--file_backup_storage_root", vttablet.FileBackupStorageRoot,
"--service_map", vttablet.ServiceMap,
"--db_charset", vttablet.Charset,
"--bind-address", "127.0.0.1",
"--grpc_bind_address", "127.0.0.1",
)
if v, err := GetMajorVersion("vttablet"); err != nil {
return err
} else if v >= 18 {
vttablet.proc.Args = append(vttablet.proc.Args, "--bind-address", "127.0.0.1")
vttablet.proc.Args = append(vttablet.proc.Args, "--grpc_bind_address", "127.0.0.1")
}

if *isCoverage {
vttablet.proc.Args = append(vttablet.proc.Args, "--test.coverprofile="+getCoveragePath("vttablet.out"))
Expand Down
Loading

0 comments on commit 8cd6da2

Please sign in to comment.