Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable -mysql_server_version in vttestserver, and utilize it in vttestserver container images #7474

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/vttestserver/Dockerfile.mysql57
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ COPY --from=builder --chown=vitess:vitess /vt/install /vt
VOLUME /vt/vtdataroot
USER vitess

CMD /vt/bin/vttestserver -port $PORT -keyspaces $KEYSPACES -num_shards $NUM_SHARDS -mysql_bind_host ${MYSQL_BIND_HOST:-127.0.0.1}
CMD /vt/bin/vttestserver -port $PORT -keyspaces $KEYSPACES -num_shards $NUM_SHARDS -mysql_bind_host ${MYSQL_BIND_HOST:-127.0.0.1} -mysql_server_version 5.7.9-vitess
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be nice to allow users to override this with an env variable.
We can default to 5.7.9-Vitess which is the internal default as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

2 changes: 1 addition & 1 deletion docker/vttestserver/Dockerfile.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ COPY --from=builder --chown=vitess:vitess /vt/install /vt
VOLUME /vt/vtdataroot
USER vitess

CMD /vt/bin/vttestserver -port $PORT -keyspaces $KEYSPACES -num_shards $NUM_SHARDS -mysql_bind_host ${MYSQL_BIND_HOST:-127.0.0.1}
CMD /vt/bin/vttestserver -port $PORT -keyspaces $KEYSPACES -num_shards $NUM_SHARDS -mysql_bind_host ${MYSQL_BIND_HOST:-127.0.0.1} -mysql_server_version 8.0.0-vitess
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably use a current mysql version - say 8.0.21.
To make this more usable, how about adding an env variable similar to the others and defaulting to 8.0.21-Vitess?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

3 changes: 3 additions & 0 deletions go/vt/vttest/vtprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ func VtcomboProcess(env Environment, args *Config, mysql MySQLManager) *VtProces
if args.VSchemaDDLAuthorizedUsers != "" {
vt.ExtraArgs = append(vt.ExtraArgs, []string{"-vschema_ddl_authorized_users", args.VSchemaDDLAuthorizedUsers}...)
}
if *servenv.MySQLServerVersion != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool. I thought we would have to add an arg.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was what I tried first, but it failed because this one was already being pulled in :)

vt.ExtraArgs = append(vt.ExtraArgs, "-mysql_server_version", *servenv.MySQLServerVersion)
}

if socket != "" {
vt.ExtraArgs = append(vt.ExtraArgs, []string{
Expand Down