Overview of the Issue
the vttestserver binary will only respect -data_dir argument if -port is also provided.
the code that needs to be changed is here.
if basePort != 0 {
if config.DataDir == "" {
env, err = vttest.NewLocalTestEnv("", basePort)
if err != nil {
return
}
} else {
env, err = vttest.NewLocalTestEnvWithDirectory("", basePort, config.DataDir)
if err != nil {
return
}
}
}
Reproduction Steps
Steps to reproduce this issue, example:
docker run -it --volume=/tmp/vt:/tmp/vt/ vitess/vttestserver:mysql57 vttestserver -data_dir /tmp/vt -alsologtostderr
Expected behaviour: data for the mysql instance is stored in /tmp/vt
Current behaviour: data for the mysql instance is stored in /vt/vtdataroot/random_dir
Overview of the Issue
the
vttestserverbinary will only respect-data_dirargument if-portis also provided.the code that needs to be changed is here.
Reproduction Steps
Steps to reproduce this issue, example:
docker run -it --volume=/tmp/vt:/tmp/vt/ vitess/vttestserver:mysql57 vttestserver -data_dir /tmp/vt -alsologtostderrExpected behaviour: data for the mysql instance is stored in
/tmp/vtCurrent behaviour: data for the mysql instance is stored in
/vt/vtdataroot/random_dir