diff --git a/build.env b/build.env index ec29213df88..3382ee06de7 100755 --- a/build.env +++ b/build.env @@ -17,7 +17,7 @@ source ./tools/shell_functions.inc go version >/dev/null 2>&1 || fail "Go is not installed or is not in \$PATH. See https://vitess.io/contributing/build-from-source for install instructions." -goversion_min 1.18.7 || fail "Go version reported: `go version`. Version 1.18.7+ required. See https://vitess.io/contributing/build-from-source for install instructions." +goversion_min 1.20.10 || fail "Go version reported: `go version`. Version 1.18.7+ required. See https://vitess.io/contributing/build-from-source for install instructions." mkdir -p dist mkdir -p bin diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index de52ea6fcf4..c31a40705be 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -21,7 +21,7 @@ # TODO(mberlin): Remove the symlink and this note once # https://github.com/docker/hub-feedback/issues/292 is fixed. -ARG bootstrap_version=20 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql57" FROM "${image}" diff --git a/docker/base/Dockerfile.mariadb b/docker/base/Dockerfile.mariadb index 31fcdcae4fa..93ea7e88a43 100644 --- a/docker/base/Dockerfile.mariadb +++ b/docker/base/Dockerfile.mariadb @@ -1,4 +1,4 @@ -ARG bootstrap_version=20 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mariadb" FROM "${image}" diff --git a/docker/base/Dockerfile.mariadb103 b/docker/base/Dockerfile.mariadb103 index db6530d08af..c41dc22cffe 100644 --- a/docker/base/Dockerfile.mariadb103 +++ b/docker/base/Dockerfile.mariadb103 @@ -1,4 +1,4 @@ -ARG bootstrap_version=20 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mariadb103" FROM "${image}" diff --git a/docker/base/Dockerfile.mysql80 b/docker/base/Dockerfile.mysql80 index 72578194b7d..9a3a88c96c9 100644 --- a/docker/base/Dockerfile.mysql80 +++ b/docker/base/Dockerfile.mysql80 @@ -1,4 +1,4 @@ -ARG bootstrap_version=20 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql80" FROM "${image}" diff --git a/docker/base/Dockerfile.percona57 b/docker/base/Dockerfile.percona57 index 8c420a71873..f5d8f3a6159 100644 --- a/docker/base/Dockerfile.percona57 +++ b/docker/base/Dockerfile.percona57 @@ -1,4 +1,4 @@ -ARG bootstrap_version=20 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-percona57" FROM "${image}" diff --git a/docker/base/Dockerfile.percona80 b/docker/base/Dockerfile.percona80 index 847d77815cb..c3e1f9c2ddf 100644 --- a/docker/base/Dockerfile.percona80 +++ b/docker/base/Dockerfile.percona80 @@ -1,4 +1,4 @@ -ARG bootstrap_version=20 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-percona80" FROM "${image}" diff --git a/docker/lite/Dockerfile.alpine b/docker/lite/Dockerfile.alpine index 5c0743bc64b..d05fd6b16ac 100644 --- a/docker/lite/Dockerfile.alpine +++ b/docker/lite/Dockerfile.alpine @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mariadb103" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.mariadb b/docker/lite/Dockerfile.mariadb index ac86fb05ef0..bbef8e2060a 100644 --- a/docker/lite/Dockerfile.mariadb +++ b/docker/lite/Dockerfile.mariadb @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mariadb" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.mariadb103 b/docker/lite/Dockerfile.mariadb103 index 7268f453c84..9e865bf39dd 100644 --- a/docker/lite/Dockerfile.mariadb103 +++ b/docker/lite/Dockerfile.mariadb103 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mariadb103" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.mysql57 b/docker/lite/Dockerfile.mysql57 index 022a5bc6191..bc5eea4b3d6 100644 --- a/docker/lite/Dockerfile.mysql57 +++ b/docker/lite/Dockerfile.mysql57 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql57" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.mysql80 b/docker/lite/Dockerfile.mysql80 index 0d44ac30a4b..e50435310c2 100644 --- a/docker/lite/Dockerfile.mysql80 +++ b/docker/lite/Dockerfile.mysql80 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql80" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.percona57 b/docker/lite/Dockerfile.percona57 index 90d698c5cb6..95ef7b7a2ab 100644 --- a/docker/lite/Dockerfile.percona57 +++ b/docker/lite/Dockerfile.percona57 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-percona57" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.percona80 b/docker/lite/Dockerfile.percona80 index c9b6d5f56b3..ef583e7299d 100644 --- a/docker/lite/Dockerfile.percona80 +++ b/docker/lite/Dockerfile.percona80 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-percona80" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.testing b/docker/lite/Dockerfile.testing index 2d6cc7917cf..08b97e2eca3 100644 --- a/docker/lite/Dockerfile.testing +++ b/docker/lite/Dockerfile.testing @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql57" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.ubi7.mysql57 b/docker/lite/Dockerfile.ubi7.mysql57 index 613d148730a..d2bbb79bdb9 100644 --- a/docker/lite/Dockerfile.ubi7.mysql57 +++ b/docker/lite/Dockerfile.ubi7.mysql57 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql57" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.ubi7.mysql80 b/docker/lite/Dockerfile.ubi7.mysql80 index ea2f13631fd..914549ff0be 100644 --- a/docker/lite/Dockerfile.ubi7.mysql80 +++ b/docker/lite/Dockerfile.ubi7.mysql80 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql80" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.ubi7.percona57 b/docker/lite/Dockerfile.ubi7.percona57 index 66e11ee3cfa..cb157ac2797 100644 --- a/docker/lite/Dockerfile.ubi7.percona57 +++ b/docker/lite/Dockerfile.ubi7.percona57 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-percona57" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.ubi7.percona80 b/docker/lite/Dockerfile.ubi7.percona80 index 4fd5a3b56b2..83e71b71c22 100644 --- a/docker/lite/Dockerfile.ubi7.percona80 +++ b/docker/lite/Dockerfile.ubi7.percona80 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-percona80" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.ubi8.arm64.mysql80 b/docker/lite/Dockerfile.ubi8.arm64.mysql80 index 038c361dd01..4ecb853b056 100644 --- a/docker/lite/Dockerfile.ubi8.arm64.mysql80 +++ b/docker/lite/Dockerfile.ubi8.arm64.mysql80 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql80" FROM "${image}" AS builder diff --git a/docker/lite/Dockerfile.ubi8.mysql80 b/docker/lite/Dockerfile.ubi8.mysql80 index 53bc06c47cb..fb5476a9e22 100644 --- a/docker/lite/Dockerfile.ubi8.mysql80 +++ b/docker/lite/Dockerfile.ubi8.mysql80 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql80" FROM "${image}" AS builder diff --git a/docker/local/Dockerfile b/docker/local/Dockerfile index 614e319d975..b3102b28bf2 100644 --- a/docker/local/Dockerfile +++ b/docker/local/Dockerfile @@ -1,4 +1,4 @@ -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-common" FROM "${image}" diff --git a/docker/vttestserver/Dockerfile.mysql57 b/docker/vttestserver/Dockerfile.mysql57 index 26b0d71a8da..8c9a3c409b3 100644 --- a/docker/vttestserver/Dockerfile.mysql57 +++ b/docker/vttestserver/Dockerfile.mysql57 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql57" FROM "${image}" AS builder diff --git a/docker/vttestserver/Dockerfile.mysql80 b/docker/vttestserver/Dockerfile.mysql80 index b25b52c3cb5..a7e62800096 100644 --- a/docker/vttestserver/Dockerfile.mysql80 +++ b/docker/vttestserver/Dockerfile.mysql80 @@ -17,7 +17,7 @@ # ensure images contain the right binaries. # Use a temporary layer for the build stage. -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-mysql80" FROM "${image}" AS builder diff --git a/go/bucketpool/bucketpool_test.go b/go/bucketpool/bucketpool_test.go index 3d74c3f94ce..7649f9b6278 100644 --- a/go/bucketpool/bucketpool_test.go +++ b/go/bucketpool/bucketpool_test.go @@ -170,6 +170,9 @@ func TestFuzz(t *testing.T) { maxTestSize := 16384 for i := 0; i < 20000; i++ { minSize := rand.Intn(maxTestSize) + if minSize == 0 { + minSize = 1 + } maxSize := rand.Intn(maxTestSize-minSize) + minSize p := New(minSize, maxSize) bufSize := rand.Intn(maxTestSize) diff --git a/go/test/endtoend/recovery/recovery_util.go b/go/test/endtoend/recovery/recovery_util.go index cf413e3d2e0..ad72d34c969 100644 --- a/go/test/endtoend/recovery/recovery_util.go +++ b/go/test/endtoend/recovery/recovery_util.go @@ -63,10 +63,9 @@ func RestoreTablet(t *testing.T, localCluster *cluster.LocalProcessCluster, tabl if err != nil { tm := time.Now().UTC() - tm.Format(time.RFC3339) _, err := localCluster.VtctlProcess.ExecuteCommandWithOutput("CreateKeyspace", "--", "--keyspace_type=SNAPSHOT", "--base_keyspace="+keyspaceName, - "--snapshot_time", restoreTime.Format(time.RFC3339), restoreKSName) + "--snapshot_time", tm.Format(time.RFC3339), restoreKSName) require.Nil(t, err) } diff --git a/go/test/fuzzing/vtctl_fuzzer.go b/go/test/fuzzing/vtctl_fuzzer.go index 93b7d1f3d4a..a1b716479a8 100644 --- a/go/test/fuzzing/vtctl_fuzzer.go +++ b/go/test/fuzzing/vtctl_fuzzer.go @@ -169,8 +169,8 @@ func Fuzz(data []byte) int { chunkSize := len(restOfArray) / numberOfCalls command := 0 for i := 0; i < len(restOfArray); i = i + chunkSize { - from := i //lower - to := i + chunkSize //upper + from := i // lower + to := i + chunkSize // upper // Index of command in getCommandType(): commandIndex := int(commandPart[command]) % 68 @@ -179,9 +179,7 @@ func Fuzz(data []byte) int { args := strings.Split(string(restOfArray[from:to]), " ") // Add params to the command - for i := range args { - commandSlice = append(commandSlice, args[i]) - } + commandSlice = append(commandSlice, args...) _ = vtctl.RunCommand(ctx, wrangler.New(logger, topo, tmc), commandSlice) command++ diff --git a/go/vt/orchestrator/logic/topology_recovery.go b/go/vt/orchestrator/logic/topology_recovery.go index e283e6d6634..2b3d2b17b85 100644 --- a/go/vt/orchestrator/logic/topology_recovery.go +++ b/go/vt/orchestrator/logic/topology_recovery.go @@ -658,6 +658,9 @@ func recoverDeadPrimary(ctx context.Context, analysisEntry inst.ReplicationAnaly // Read the tablet information from the database to find the shard and keyspace of the tablet tablet, err := inst.ReadTablet(analysisEntry.AnalyzedInstanceKey) + if err != nil { + return false, nil, err + } var candidateTabletAlias *topodatapb.TabletAlias if candidateInstanceKey != nil { diff --git a/test.go b/test.go index aabe8fab363..df23833e06b 100755 --- a/test.go +++ b/test.go @@ -76,7 +76,7 @@ For example: // Flags var ( flavor = flag.String("flavor", "mysql57", "comma-separated bootstrap flavor(s) to run against (when using Docker mode). Available flavors: all,"+flavors) - bootstrapVersion = flag.String("bootstrap-version", "10.2", "the version identifier to use for the docker images") + bootstrapVersion = flag.String("bootstrap-version", "15", "the version identifier to use for the docker images") runCount = flag.Int("runs", 1, "run each test this many times") retryMax = flag.Int("retry", 3, "max number of retries, to detect flaky tests") logPass = flag.Bool("log-pass", false, "log test output even if it passes") diff --git a/test/templates/dockerfile.tpl b/test/templates/dockerfile.tpl index a5ceda17b7c..49517940f8c 100644 --- a/test/templates/dockerfile.tpl +++ b/test/templates/dockerfile.tpl @@ -1,4 +1,4 @@ -ARG bootstrap_version=10.2 +ARG bootstrap_version=15 ARG image="vitess/bootstrap:${bootstrap_version}-{{.Platform}}" FROM "${image}"