[MDEV-27214] Import with disabled keys corrupts meta-data like rows, indexes, ... Created: 2021-12-09 Updated: 2023-03-29 Resolved: 2022-11-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Backup, Data Manipulation - Insert, Storage Engine - InnoDB |
| Affects Version/s: | 10.6.5, 10.6.7, 10.6.8, 10.6.9, 10.6.10 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Alex | Assignee: | Alexander Barkov |
| Resolution: | Duplicate | Votes: | 4 |
| Labels: | None | ||
| Environment: |
CentOS 7 |
||
| Attachments: |
|
||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
When importing a dump created by mysqldump with default options meta-data like Rows and Avg_row_length are 0 and Data_length is 16 KB and indexes are not available anymore which leads to long running or locking queries. Only after executing an optimize table afterwards corrects this or whem using the option skip-disable-keys for creating dump. In the following example the Data_length is always 16 KB, because of the small table: Test Table Import with default dump Rows: 0 Recreate Table Rows: 3 Import with dump without disabled keys Rows: 3 |
| Comments |
| Comment by Alex [ 2022-03-01 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Same behaviour on 10.6.7 | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2022-10-28 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Reproduceable also with 10.6.8, 10.6.9 and latest 10.6.10. However, the behavior is different: After a restart it is working for some time, once it fails at 10.6.7 every further request will fail, but with 10.6.8, 10.6.9, 10.6.10 further requests will work again but it will fail again afterwards. Tested with the following shell-script:
Attached output of 10.6.7, .8, .9 and latest .10: metadata-test.txt | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2022-11-11 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
A similar problem is repeatable with 10.7.6: The row statistics is empty if I set UNIQUE_CHECKS and FOREIGN_KEY_CHECKS to 0:
The row statistics is not empty if I set UNIQUE_CHECKS and FOREIGN_KEY_CHECKS to 1:
| ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2022-11-11 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Repeatable with 10.6.10 and 10.7.6 with the following MTR test:
This is the output:
| ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2022-11-11 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
The problem is not repeatable in 10.6.11 after this patch:
So it appeared that this problem duplicates | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2022-11-11 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Hi marko, can you please review a patch? https://github.com/MariaDB/server/commit/aa1a9e21895b675c01133a74493c3abaa3b6dee1 Thanks. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-11-11 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
OK to push after addressing my review comments. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2022-11-11 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Here's an updated version: | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-11-11 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Thank you! I think that it was good to extend the test to cover all innodb_page_size. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2022-11-11 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
It appeared that this issues was fixed earlier. Added tests only. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2022-11-17 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
It looks like @bar You wrote that it is not reproduceable with 10.6.11, have you tried my shell-script? Attached is a new test-report with 10.6.10 and 10.6.11, where it can be seen that the issue is still existing. |