[MDEV-9581] [PATCH] Innodb in Mariadb-10.1.x is unable to start up with data files generated by older version Created: 2016-02-18 Updated: 2017-10-27 Resolved: 2017-01-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.1 |
| Fix Version/s: | 10.1.21 |
| Type: | Bug | Priority: | Critical |
| Reporter: | David Zhao | Assignee: | Rasmus Johansson (Inactive) |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | innodb, page_size, tablespace | ||
| Environment: |
linux, commodity pc server. Linux storm0 2.6.32.43-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 |
||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Sprint: | 10.1.13 | ||||||||||||||||||||||||
| Description |
|
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. 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. |
| Comments |
| Comment by Elena Stepanova [ 2016-02-18 ] | |||||||||||
|
DZW, | |||||||||||
| Comment by Jan Lindström (Inactive) [ 2016-02-19 ] | |||||||||||
|
This is basically duplicate of https://mariadb.atlassian.net/browse/MDEV-9362 and your solution while correct does not solve the migration from 10.1.10 to version where these flags are corrected. | |||||||||||
| Comment by David Zhao [ 2016-02-19 ] | |||||||||||
|
Hi Jan Lindström, Thanks for your comment. And are you saying that there are further issues around the migration and my patch doesn't solve all of them? Because I'm concerned about whether I can use my patch in production environment now, or do I have to wait for mariadb's official solution(and when will the version with the solution be released?). What I found is that the patch solves the problem and mysqld can start up with old data files after the patch is applied. Regards, | |||||||||||
| Comment by Jan Lindström (Inactive) [ 2016-02-19 ] | |||||||||||
|
There is similar problem on dictionary flags. Furthermore, if you just move the placement of the individual flags, your existing databases created using 10.1 using these new flags would not work. I'm currently working on patch and I hope it will be released on 10.1.12, this patch I plan to make so that you do not need to export all tables and import them back, but no promises yet as fix is not 100% ready (currently I would say 90% for xtradb). Furthermore, as you fixed only xtradb, similar fix is needed for innodb plugin. | |||||||||||
| Comment by David Zhao [ 2016-02-19 ] | |||||||||||
|
Thanks for the quick reply. My further questions: 1. Is it possible for me to see your unreleased fix? Is it in some development branch somewhere? or could you please send me a patch of it? and btw, in my above patch I did fix both innodb and xtradb, actually I am using innodb rather than xtradb. | |||||||||||
| Comment by Jan Lindström (Inactive) [ 2016-02-19 ] | |||||||||||
|
Hi, (1) I have not yet committed the patch anywhere as it does not yet work fully. (2) There is following problem: We (MariaDB) and Oracle have done independent development, this means that we and Oracle have used same tablespace flags bits (fsp->flags) and dictionary flags bits (sys_tables.flags). This will become even worse with MySQL 5.7. Thus, I wanted solution that works for 10.1 as well as our 10.2 under development (I'm merging 5.7 InnoDB). My solution is simple, I remove our extended flags PAGE_COMPRESSION,PAGE_COMPRESSION_LEVEL, and ATOMIC_WRITES from both fsp flags and dictionary flags and use new system table SYS_TABLE_OPTIONS instead where this information is stored. This means your patch is not compatible with my solution. I'm in process adding a methods that will migrate existing 10.1 databases using those flags to our new solution. | |||||||||||
| Comment by Thierry Laurier [ 2016-06-28 ] | |||||||||||
|
Created with 10.0.25 debian version, upgraded with 10.1.14 of mariadb.org for debian jessie.
| |||||||||||
| Comment by Jan Lindström (Inactive) [ 2016-06-29 ] | |||||||||||
|
Hi, can you provide your database, I will try to investigate ? | |||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-01-23 ] | |||||||||||
|
This issue has been fixed on https://jira.mariadb.org/browse/MDEV-11623, thus closing this. |