[MDEV-20194] Warnings inconsistently issued upon CHECK on table from older versions Created: 2019-07-27 Updated: 2023-08-22 Resolved: 2022-04-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Admin statements, Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3 |
| Fix Version/s: | 10.3.35, 10.4.25, 10.5.16, 10.6.8 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Note: I'm fine with closing it as not a bug as long as all aspects of the new behavior are considered and confirmed to be expected. It was discussed a little on slack as a probably innocent consequence of Here is an example of the table:
Server options: --innodb-compression-algorithm=none --innodb-page-size=4K, otherwise defaults. The table gets created on a pre-
First, it's unclear whether Secondly, the warning, if it's true, could have been helpful if it was reliable; but it is only issued on the first opening of the table:
Which makes it fairly useless. And finally, the error log gets a different strange-looking warning instead:
|
| Comments |
| Comment by Elena Stepanova [ 2019-07-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also, innodb.innodb-32k-crash test non-deterministically produces the same warning:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-08-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This warning would seem to imply that the c08 column is being added by some DDL statement, so it doesn't really make sense in the context of CHECK TABLE. I think this warning should be improved. See also MDEV-16969. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-08-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This bug also affects mysql_upgrade, since that tool executes "CHECK TABLE ... FOR UPGRADE". To reproduce with mysql_upgrade, do the following: Create a table with a row size that is too large:
Then, restart the server:
Then, before you do anything else with the database, run mysql_upgrade:
mysql_upgrade will finish successfully, and it won't report any errors. However, it will cause the misleading warning to be written to the MariaDB error log.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-08-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
kevg, I think that such messages should only be issued to the client connection when executing DDL statements. If we are loading an ‘unsafe’ table definition to the data dictionary cache, we should be silent. If the row size is too large, that should then result in an error on an INSERT or UPDATE operation. Side note: The FOR UPGRADE clause of CHECK TABLE is being ignored by InnoDB. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-09-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The big picture looks good. I think that I found some inaccuracy in the calculation of the maximum node pointer record size. You do not seem to be accounting for the 4-byte child page number field. For the clustered index node pointer records, the node pointer size should never cause problems. This is because the node pointer records will be (primary_key_columns,child_page_number), while the leaf page records are (primary_key_columns,DB_TRX_ID,DB_ROLL_PTR,any_non_pk_columns). The system columns DB_TRX_ID,DB_ROLL_PTR are 13 bytes, while the child_page_number is only 4 bytes. So, we should enforce the maximum node pointer record size only for secondary indexes. Note that for SPATIAL INDEX, the maximum node pointer record size can never become a problem. I think that the node pointer is DATA_MBR_LEN (4*sizeof(double)) followed by the child page number (no PRIMARY KEY columns, but you’d better check that). The leaf page records are DATA_MBR_LEN followed by the PRIMARY KEY columns. That might theoretically become a bottleneck with a 16-column PRIMARY KEY consisting of very long maximum values, if all columns of the table belong to the PRIMARY KEY. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2019-10-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
"If we are loading an ‘unsafe’ table definition to the data dictionary cache, we should be silent." This is also an issue as the error log can be flooded with such messages, especially after startup when the table_definition_cache is still "cold". This can become especially "interesting" when having heavily partition tables, where the warning is logged for each individual partition. Should we keep this aspect as part of this ticked, or should we actually split this aspect out into a new MDEV of its own? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2019-10-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also if we decide to continue having these warnings in the error log, could we at least only have them logged if innodb_strict_mode=ON? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-10-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Another option is that if innodb_strict_mode=OFF is set, then the logging behavior can be based on log_warnings, as requested in | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-11-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Some of my comments related to the | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-03-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As demonstrated in | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Thirunarayanan Balathandayuthapani [ 2022-04-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Patch is in bb-10.3- | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-04-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you. I spotted a possible off-by-one error for ROW_FORMAT=REDUNDANT node pointer records. Otherwise, it looks OK to me. |