Description:
In MySQL 5.7 GA versions, mysql_install_db have two changes that affects autotest.
1) If the data dir to be installed already exists it must be empty. Autotest have defaulted to use a data dir that also could contain other files.
2) mysql_install_db no longer creates the test database. Autotest used the test database as default database on connect to server, but do not really use that. Tests creates needed databases by them selves. And also atrt creates its own atrt database to handle upgrades.
How to repeat:
Try to run upgrade autotest which needs a mysql installation:
./autotest-boot.sh --clone0=mysql-5.7-cluster-7.5 --clone1=mysql-5.7-cluster-7.5 upgrade
2016-03-05 17:35:04 [ndb_atrt] ERROR -- Failed to mysql_install_db for /.../run-daily-basic-mysql-5.7-cluster-7.5-target/run/cluster.atrt/mysqld.1, cmd: '/.../bin/mysql_install_db --defaults-file=/.../run-daily-basic-mysql-5.7-cluster-7.5-target/run/my.cnf --basedir=/... --datadir=/.../run-daily-basic-mysql-5.7-cluster-7.5-target/run/cluster.atrt/mysqld.1 > /.../run-daily-basic-mysql-5.7-cluster-7.5-target/run/cluster.atrt/mysqld.1/mysql_install_db.log 2>&1'
In cluster.atrt/mysqld.1/mysql_install_db.log:
2016-03-05 17:35:04 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2016-03-05 17:35:04 [ERROR] The data directory '/.../run-daily-basic-mysql-5.7-cluster-7.5-target/run/cluster.atrt/mysqld.1' already exist and is not empty.
After the default datadir been changed, a new error showed up:
2016-03-05 17:45:48 [ndb_atrt] ERROR -- Failed to connect to mysqld err: >Unknown database 'test'< >localhost:
14002:mysql.sock<
2016-03-05 17:45:48 [ndb_atrt] CRITICAL -- Failed to setup database
Suggested fix:
1) make atrt use $PWD/data as default mysql datadir, instead of $PWD.
2) make atrt connect to mysqld without any default database, instead of using test.
Note, since atrt from one version can be used to setup an cluster using another version, the atrt programs should be updated in the same way for all GA versions of cluster, that is for 7.2 and up.