[MDEV-20357] Strange auto_increment counter setting changes on direct upgrade from 10.1 to 10.3 Created: 2019-08-15 Updated: 2020-04-24 Resolved: 2019-09-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.3.17 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | Marko Mäkelä |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | need_feedback | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
After a direct upgrade from 10.1.40 to 10.3.17, SHOW CREATE TABLE output in mysqldump shows correct AUTO_INCREMENT counter values on the first two tables, but then flips to Before the upgrade:
becomes this after upgrade:
Note how starting with the third auto-inrement table the counter becomes way higher then originally, and then gets incremented by 11 for each following table. |
| Comments |
| Comment by Marko Mäkelä [ 2019-08-16 ] | |
|
hholzgra, I think that this should affect an upgrade to 10.2 already, due to I think that the plausible explanation is that the PAGE_MAX_AUTOINC field in some clustered index root pages was not 0, but garbage, before the upgrade. It should be possible to reset the AUTO_INCREMENT value by a statement like this:
This should reset the counter to a value that is not smaller than the current maximum in the table. I will try to double-check if the PAGE_MAX_TRX_ID was always zero-initialized. I seem to remember that I concluded during | |
| Comment by Marko Mäkelä [ 2019-08-16 ] | |
|
As a starting point, I checked out the MySQL 5.1.47 source code. Side note: I had forgotten a glaring bug: changes of the PAGE_MAX_TRX_ID were not being redo-logged in the built-in InnoDB of MySQL 5.1. It was only fixed in the InnoDB Plugin, which became the basis of the InnoDB in the 5.5 release. In MySQL 5.1.47, page_create() (which is invoked for creating B-tree pages) did always initialize the PAGE_MAX_TRX_ID, so we do know that whenever the field was unused on a B-tree page, it must have been 0:
This call was present in the very beginning of the InnoDB revision history. hholzgra, I am afraid that I cannot explain the observed anomaly with a software bug. I would need more information at the very least. | |
| Comment by Sergei Golubchik [ 2019-09-16 ] | |
|
hholzgra, any chance you could provide more infore or should we close it? |