Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into vmg/upgrade-protobuf
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <andres@planetscale.com>
  • Loading branch information
systay committed May 18, 2021
2 parents 3a43aff + 48f22aa commit f6facb9
Show file tree
Hide file tree
Showing 95 changed files with 10,257 additions and 7,167 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ grpcvtctldclient: go/vt/proto/vtctlservice/vtctlservice.pb.go
parser:
make -C go/vt/sqlparser

codegen: asthelpergen sizegen parser
codegen: asthelpergen sizegen parser astfmtgen

visitor: asthelpergen
echo "make visitor has been replaced by make asthelpergen"
Expand Down
6 changes: 4 additions & 2 deletions doc/releasenotes/10_0_0_release_notes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
This release complies with VEP-3 which removes the upgrade order requirement. Components can be upgraded in any order. It is recommended that the upgrade order should still be followed if possible, except to canary test the new version of VTGate before upgrading the rest of the components.


The following PRs made changes to behaviors that clients might rely on. They should be reviewed carefully so that client code can be changed in concert with a Vitess release deployment.
## Known Issues
* Running binaries with `--version` or running `select @@version` from a MySQL client still shows `10.0.0-RC1`
* Online DDL [cannot be used](https://github.com/vitessio/vitess/pull/7873#issuecomment-822798180) if you are using the keyspace filtering feature of VTGate
* VReplication errors when a fixed-length binary column is used as the sharding key #8080

## Bugs Fixed

Expand Down
18 changes: 18 additions & 0 deletions docker/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ vitess$ docker/bootstrap/build.sh common
vitess$ docker/bootstrap/build.sh mysql56
```

Is it also possible to specify the resulting image name:

```sh
vitess$ docker/bootstrap/build.sh common --image my-common-image
```

If custom image names are specified, you might need to set the base image name when building flavors:

```sh
vitess$ docker/bootstrap/build.sh mysql56 --base_image my-common-image
```

Both arguments can be combined. For example:

```sh
vitess$ docker/bootstrap/build.sh mysql56 --base_image my-common-image --image my-mysql-image
```

## For Vitess Project Maintainers

To update all bootstrap images on Docker Hub, you can use the `docker_bootstrap`
Expand Down
30 changes: 29 additions & 1 deletion docker/bootstrap/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Usage:
#
# First build the `common` image, then any flavors you want. For example:
# $ docker/bootstrap/build.sh common
# $ docker/bootstrap/build.sh mysql56
#
# Is it also possible to specify the resulting image name:
# $ docker/bootstrap/build.sh common --image my-common-image
#
# If custom image names are specified, you might need to set the base image name when building flavors:
# $ docker/bootstrap/build.sh mysql56 --base_image my-common-image
# Both arguments can be combined. For example:
# $ docker/bootstrap/build.sh mysql56 --base_image my-common-image --image my-mysql-image


flavor=$1
if [[ -z "$flavor" ]]; then
Expand All @@ -33,6 +48,19 @@ chmod -R o=g *

arch=$(uname -m)
[ "$arch" == "aarch64" ] && [ $flavor != "common" ] && arch_ext='-arm64v8'


base_image="${base_image:-vitess/bootstrap:$version-common}"
image="${image:-vitess/bootstrap:$version-$flavor$arch_ext}"

while [ $# -gt 0 ]; do
if [[ $1 == *"--"* ]]; then
param="${1/--/}"
declare $param="$2"
fi
shift
done

if [ -f "docker/bootstrap/Dockerfile.$flavor$arch_ext" ]; then
docker build --no-cache -f docker/bootstrap/Dockerfile.$flavor$arch_ext -t vitess/bootstrap:$version-$flavor$arch_ext --build-arg bootstrap_version=$version .
docker build --no-cache -f docker/bootstrap/Dockerfile.$flavor$arch_ext -t $image --build-arg bootstrap_version=$version --build-arg image=$base_image .
fi
3 changes: 3 additions & 0 deletions go/mysql/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,9 @@ func (c *Conn) handleNextCommand(handler Handler) bool {
}
return false
}
if len(data) == 0 {
return false
}

switch data[0] {
case ComQuit:
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 4 additions & 3 deletions go/mysql/mysql_fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (t fuzztestRun) ComQuery(c *Conn, query string, callback func(*sqltypes.Res
}

func (t fuzztestRun) ComPrepare(c *Conn, query string, bindVars map[string]*querypb.BindVariable) ([]*querypb.Field, error) {
panic("implement me")
return nil, nil
}

func (t fuzztestRun) ComStmtExecute(c *Conn, prepare *PrepareData, callback func(*sqltypes.Result) error) error {
Expand All @@ -119,8 +119,8 @@ type fuzztestConn struct {
}

func (t fuzztestConn) Read(b []byte) (n int, err error) {
for j, i := range t.queryPacket {
b[j] = i
for i := 0; i < len(b) && i < len(t.queryPacket); i++ {
b[i] = t.queryPacket[i]
}
return len(b), nil
}
Expand Down Expand Up @@ -205,6 +205,7 @@ func FuzzHandleNextCommand(data []byte) int {
pos: -1,
queryPacket: data,
})
sConn.PrepareData = map[uint32]*PrepareData{}

handler := &fuzztestRun{}
_ = sConn.handleNextCommand(handler)
Expand Down
46 changes: 46 additions & 0 deletions go/mysql/mysql_fuzzer_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2021 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package mysql

import (
"io/ioutil"
"path"
"runtime/debug"
"testing"

"github.com/stretchr/testify/require"
)

func TestFuzzHandleNextCommandFromFile(t *testing.T) {
directoryName := "fuzzdata"
files, err := ioutil.ReadDir(directoryName)
require.NoError(t, err)
for _, file := range files {
t.Run(file.Name(), func(t *testing.T) {
defer func() {
r := recover()
if r != nil {
t.Error(r)
t.Fatal(string(debug.Stack()))
}
}()
testcase, err := ioutil.ReadFile(path.Join(directoryName, file.Name()))
require.NoError(t, err)
FuzzHandleNextCommand(testcase)
})
}
}
2 changes: 1 addition & 1 deletion go/mysql/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ type Listener struct {
PreHandleFunc func(context.Context, net.Conn, uint32) (net.Conn, error)
}

// NewFromListener creares a new mysql listener from an existing net.Listener
// NewFromListener creates a new mysql listener from an existing net.Listener
func NewFromListener(l net.Listener, authServer AuthServer, handler Handler, connReadTimeout time.Duration, connWriteTimeout time.Duration) (*Listener, error) {
cfg := ListenerConfig{
Listener: l,
Expand Down
Loading

0 comments on commit f6facb9

Please sign in to comment.