Skip to content

Commit

Permalink
Addition of the release summary for v12.0.5 (#10864)
Browse files Browse the repository at this point in the history
* Addition of the release summary for v12.0.5

Signed-off-by: Florent Poinsard <[email protected]>

* Fix upgrade tests - remove unwanted checkout to HEAD

Signed-off-by: Florent Poinsard <[email protected]>

* Use InitShardMaster only if <= v12

Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui authored Jul 27, 2022
1 parent 5fdafec commit f1aa624
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/cluster_endtoend_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ jobs:
mkdir -p /tmp/vitess-build-${{ matrix.project }}/
cp -R bin /tmp/vitess-build-${{ matrix.project }}/
- name: Check out HEAD
uses: actions/checkout@v2

- name: Run cluster endtoend test ${{ matrix.project }} (create cluster)
timeout-minutes: 5
run: |
Expand Down
9 changes: 9 additions & 0 deletions doc/releasenotes/12_0_5_summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Major Changes

### Upgrade to `go1.17.12`

Vitess `v12.0.5` now runs on `go1.17.12`.
The patch release of Go, `go1.17.12`, is the reason for this release as it includes important security fixes to packages used by Vitess.
Below is a summary of this patch release. You can learn more [here](https://go.dev/doc/devel/release#go1.17).

> go1.17.12 (released 2022-07-12) includes security fixes to the compress/gzip, encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath packages, as well as bug fixes to the compiler, the go command, the runtime, and the runtime/metrics package. [See the Go 1.17.12 milestone](https://github.com/golang/go/issues?q=milestone%3AGo1.17.12+label%3ACherryPickApproved) on our issue tracker for details.
23 changes: 20 additions & 3 deletions go/test/endtoend/cluster/cluster_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"os/exec"
"os/signal"
"path"
"regexp"
"strconv"
"sync"
"syscall"
Expand Down Expand Up @@ -85,10 +86,10 @@ type LocalProcessCluster struct {

nextPortForProcess int

//Extra arguments for vtTablet
// Extra arguments for vtTablet
VtTabletExtraArgs []string

//Extra arguments for vtGate
// Extra arguments for vtGate
VtGateExtraArgs []string
VtGatePlannerVersion planbuilder.PlannerVersion

Expand Down Expand Up @@ -363,7 +364,7 @@ func (cluster *LocalProcessCluster) StartKeyspace(keyspace Keyspace, shardNames
}
}

//Apply VSchema
// Apply VSchema
if keyspace.VSchema != "" {
if err = cluster.VtctlclientProcess.ApplyVSchema(keyspace.Name, keyspace.VSchema); err != nil {
log.Errorf("error applying vschema: %v, %v", keyspace.VSchema, err)
Expand Down Expand Up @@ -806,3 +807,19 @@ func getCoveragePath(fileName string) string {
}
return path.Join(covDir, fileName)
}

func GetMajorVersion(binaryName string) (int, error) {
version, err := exec.Command(binaryName, "--version").Output()
if err != nil {
return 0, err
}
versionRegex := regexp.MustCompile(`Version: ([0-9]+)\.([0-9]+)\.([0-9]+)`)
v := versionRegex.FindStringSubmatch(string(version))
if len(v) != 4 {
return 0, fmt.Errorf("could not parse server version from: %s", version)
}
if err != nil {
return 0, fmt.Errorf("could not parse server version from: %s", version)
}
return strconv.Atoi(v[1])
}
10 changes: 9 additions & 1 deletion go/test/endtoend/cluster/vtctlclient_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,16 @@ func (vtctlclient *VtctlClientProcess) InitShardPrimary(Keyspace string, Shard s
// version_upgrade test depends on using older binaries
// which means we cannot use the new InitShardPrimary command here
// TODO(deepthi): fix after v12.0
version, err := GetMajorVersion("vttablet")
if err != nil {
return err
}
cmd := "InitShardMaster"
if version > 12 {
cmd = "InitShardPrimary"
}
output, err := vtctlclient.ExecuteCommandWithOutput(
"InitShardMaster",
cmd,
"-force", "-wait_replicas_timeout", "31s",
fmt.Sprintf("%s/%s", Keyspace, Shard),
fmt.Sprintf("%s-%d", Cell, TabletUID))
Expand Down

0 comments on commit f1aa624

Please sign in to comment.