[MDEV-18128] Simplify .ibd file creation Created: 2019-01-03 Updated: 2019-08-19 Resolved: 2019-08-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.2.27, 10.3.18, 10.4.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | backup, encryption | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Description |
|
When InnoDB creates an .ibd file, it first writes a dummy page 0 with no information about encryption. This may prevent Mariabackup 10.2.20 or 10.2.21 from copying encrypted data files that were craeted shortly before backup started. Maybe we should create a 0-byte .ibd file first, and then let page flushing write the first pages? Alternatively, preallocate a zero-filled file and then let page flushing do its job. A valid page 0 must be written to the created files before writing any other pages. Otherwise, crash recovery cannot work. |
| Comments |
| Comment by Marko Mäkelä [ 2019-01-04 ] | ||||||
|
It looks like crash recovery is broken because of this. Here is a test that initializes the database and kills&restarts it soon after that. It can occasionally fail:
Perhaps, in order to simplify things, we can keep the crash-unsafe creation of the InnoDB system tablespace that only happens when the database is initialized, and only fix the .ibd file creation. After all, I would at some point (MDEV-11633) make the InnoDB system tablespace optional (split its contents into more manageable pieces). | ||||||
| Comment by Marko Mäkelä [ 2019-08-16 ] | ||||||
|
This looks OK. Unfortunately, we were unable to reproduce failures with mariabackup --backup --skip-encrypted-backup with or without the patch. The purpose of that option was to work around this bug. I think that we should remove that option in 10.5. | ||||||
| Comment by Marko Mäkelä [ 2019-08-16 ] | ||||||
|
The commit message accidentally omitted the bug title. |