[MDEV-18097] Indicate which InnoDB data files are zero-initialized Created: 2018-12-28 Updated: 2019-03-14 Resolved: 2019-02-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.4.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | init, upgrade | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Originally, InnoDB did not zero-initialize buffer pool blocks that were allocated to a file page. Because of this, unused bytes on data pages could contain any garbage, belonging to the previous contents of the buffer pool block, such as another data page, or a generic memory allocation (BUF_BLOCK_MEMORY, buf_block_alloc(), MEM_HEAP_BUFFER) that is used by the adaptive hash index, crash recovery, record locks. The page initialization was finally added in MySQL 5.1.48 for all data files. The original author of InnoDB opposed the initialization for many years, because he feared that it might cost some performance. To make it easier to repurpose unused data fields in the future, we should introduce a flag in FSP_SPACE_FLAGS to indicate that any unused fields in the data file are zero-initialized. At least since We must be careful to never set this flag on old data files without first having rewritten all pages. This could be implemented in a conversion tool later. |
| Comments |
| Comment by Marko Mäkelä [ 2018-12-28 ] |
|
10.1.patch There also is a downgrade problem. A prerequisite for implementing this should be to ensure that IMPORT TABLESPACE to older versions works. |
| Comment by Marko Mäkelä [ 2019-02-27 ] |
|
After to |
| Comment by Geoff Montee (Inactive) [ 2019-03-01 ] |
|
I updated the docs here: Are pages for tables with ROW_FORMAT=COMPRESSED guaranteed to be zero-initialized if |