Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6
Description
As I noted in MDEV-25852, recovery should probably maintain a mapping from file names to tablespace IDs, so that it can avoid repeated reads of the same page. We are not only unnecessarily re-reading files during recovery, but also displaying messages about it:
10.6 6fbf978eec4506eb46737ac4da00ea04403ae855 |
2021-06-10 20:59:34 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-53.ibd' with space ID 1594. Another data file called ./cool_down/t3.ibd exists with the same space ID.
|
2021-06-10 20:59:34 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-53.ibd' with space ID 1594. Another data file called ./cool_down/t3.ibd exists with the same space ID.
|
2021-06-10 20:59:34 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-53.ibd' with space ID 1594. Another data file called ./cool_down/t3.ibd exists with the same space ID.
|
2021-06-10 20:59:34 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-53.ibd' with space ID 1606. Another data file called ./cool_down/t1.ibd exists with the same space ID.
|
2021-06-10 20:59:34 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-53.ibd' with space ID 1606. Another data file called ./cool_down/t1.ibd exists with the same space ID.
|
2021-06-10 20:59:34 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-53.ibd' with space ID 1606. Another data file called ./cool_down/t1.ibd exists with the same space ID.
|
2021-06-10 20:59:34 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-57.ibd' with space ID 1624. Another data file called ./cool_down/t4.ibd exists with the same space ID.
|
2021-06-10 20:59:34 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-57.ibd' with space ID 1624. Another data file called ./cool_down/t4.ibd exists with the same space ID.
|
2021-06-10 20:59:34 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-57.ibd' with space ID 1624. Another data file called ./cool_down/t4.ibd exists with the same space ID.
|
2021-06-10 20:59:35 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-57.ibd' with space ID 1811. Another data file called ./test/t4.ibd exists with the same space ID.
|
2021-06-10 20:59:35 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-57.ibd' with space ID 1811. Another data file called ./test/t4.ibd exists with the same space ID.
|
2021-06-10 20:59:35 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-3116aa-57.ibd' with space ID 1811. Another data file called ./test/t4.ibd exists with the same space ID.
|
In deferred_spaces.add() the existence of a name-to-ID mapping would avoid a full traversal of the data structure:
char *fil_path= fil_make_filepath(nullptr, {filename, strlen(filename)}, |
IBD, false); |
const item defer{lsn, fil_path, false}; |
ut_free(fil_path);
|
|
/* The file name must be unique. Keep the one with the latest LSN. */ |
auto d= defers.begin();
|
|
while (d != defers.end()) |
{
|
if (d->second.file_name != defer.file_name) |
++d;
|
Here, also the call to fil_make_filepath() could be unnecessary and possibly should be removed. (It has to be tested extensively with DATA DIRECTORY.)
Last, somewhat related to this (and MDEV-24626), I think that Datafile::read_first_page() needs to be simplified. We should only read the first innodb_page_size bytes from the file. If the file is shorter than that, or all bytes are NUL, we will use deferred_spaces. If the FSP_SPACE_FLAGS matches our innodb_page_size and the checksum are valid, we will return the tablespace ID. Else, we will use deferred_spaces.
Attachments
Issue Links
- relates to
-
MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer
- Closed
-
MDEV-28389 Data too long for column 'line'
- Closed
-
MDEV-29987 Bogus errors about file size in the test mariabackup.defer_space
- Closed
-
MDEV-32120 [ERROR] InnoDB: Expected tablespace id 1525 but found 1537 in the file ./test/t1.ibd during mariabackup --backup
- Open
-
MDEV-24626 Remove synchronous write of page0 and flushing file during file creation
- Closed
-
MDEV-25568 "RENAME TABLE" causes "Ignoring data file ... with space ID xxxx, since the redo log references ... with space ID xxxx."
- Closed
-
MDEV-25852 Orphan #sql*.ibd files are occasionally left behind after killed ALTER TABLE
- Closed
-
MDEV-26326 MDEV-24626 (remove synchronous page0 write) seems to cause mariabackup to skip valid ibd file.
- Closed
-
MDEV-34830 LSN in the future is not being treated as serious corruption
- Closed