[MDEV-31634] [ERROR] InnoDB: Expected tablespace id 5512 but found 310655 in the file ./test/tbl1.ibd Created: 2023-07-05 Updated: 2023-08-28 Resolved: 2023-08-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.6.11 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Allen Lee (Inactive) | Assignee: | Allen Lee (Inactive) |
| Resolution: | Incomplete | Votes: | 1 |
| Labels: | None | ||
| Description |
|
| Comments |
| Comment by Marko Mäkelä [ 2023-07-06 ] | ||||||||||||
|
Each InnoDB data page contains a 32-bit tablespace identifier (at byte offset 34 from the start of each page) as well as a 32-bit page number (at byte offset 4). To diagnose something like this, we’d need to see a copy of the first 3 pages of the file:
These pages never contain any user data, only some metadata. If encryption is involved, it might be that the tablespace ID had not been decrypted correctly. In MariaDB, the first page should never be encrypted even in encrypted .ibd files. | ||||||||||||
| Comment by Marko Mäkelä [ 2023-07-06 ] | ||||||||||||
|
The error message will be output by fil_node_t::read_page0(). If the first page of an InnoDB data file is deemed corrupted, the file cannot be accessed. Without getting a copy of the data, it will be impossible to diagnose this further. | ||||||||||||
| Comment by Marko Mäkelä [ 2023-07-27 ] | ||||||||||||
|
The pages should not contain any application data, only some metadata related to space management within the .ibd file. Here is an except of some page header bytes:
I also ran innochecksum on the file. It did not complain about the first page (which is not encrypted), but did complain about the second one because no support for encryption has been implemented in that tool:
The first page looks valid for tablespace 0x4bd7f (310655), but page 1 (change buffer bitmap page) contains the tablespace identifier 0x1588 (5512). For page 2, the tablespace identifier field contains yet something else. I was under the impression that innodb_encrypt_tables would encrypt the tablespace identifier as well, but I may be mistaken about that. A bug like |