Status: Closed (View Workflow)
Affects Version/s: 10.1
Fix Version/s: 10.1.21
Environment:linux, commodity pc server.
Linux storm0 188.8.131.52-tlinux-1.0.10-default #1 SMP Fri Jan 30 11:15:12 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-4)
Linux TENCENT64.site 3.10.0-1-tlinux2-0014.tl2 #1 SMP Wed Mar 11 11:43:03 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
The procedure to reproduce the issue as below, and analysis follows.
1. Build and start up mariadb-10.0.10 to create a table with innodb storage engine, and insert some rows into it. Note that in my.cnf, set innodb-page-size to 4k.
2. shutdown mysqld and keep the data directory intact.
3. build and start up maraidb-10.1.9(the version I am using) and start up mysqld, using exactly the same my.cnf file and data directory as above.
4. mysqld fails to startup with below error in mysqld.err:
The cause is that the newly added tablespace flags is wrongly placed: the PAGE_COMPRESSION, PAGE_COMPRESSION_LEVEL and ATOMIC_WRITES flags added in 10.1.x occupies the position of PAGE_SIZE, pushing PAGE_SIZE behind, so when new version mysqld reads the tablespace flags of old data file, the PAGE_SIZE is read as 0, so innodb thinks the default 16k is used, but UNIV_PAGE_SIZE is 4k as specified by my.cnf, hence the error.
I have made a fix, please review. The patch passes all tests in mysql-test.
I saw in latest release (mariadb-10.1.11) the relevant code keeps the same so the issue most probably exist in it too.