[MDEV-21651] mysql_upgrade fails without providing any meaningful diagnostics Created: 2020-02-04 Updated: 2023-11-28 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.4.10, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11 |
| Fix Version/s: | 10.4, 10.5, 10.6, 10.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | Philip orleans | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
after upgrading to 1.4 from 10.3, I execute mysql_upgrade and I get so what comes next is generating the error. How do we know what code is being applied? |
| Comments |
| Comment by Elena Stepanova [ 2020-03-07 ] | ||||
|
Could you please attach the schema dump of mysql database which you're trying to upgrade? No data, just the schema. | ||||
| Comment by Philip orleans [ 2020-04-11 ] | ||||
|
Same issue upgrading. I cannot publish the schema, but I can give access to Elena so she can see the issue Version: '10.4.12-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server | ||||
| Comment by Philip orleans [ 2020-04-11 ] | ||||
|
I need to emphasize that we need a path to upgrade, not dump and reload, which is impossible for very large databases and imposes a downtime that we cannot afford. | ||||
| Comment by Elena Stepanova [ 2020-04-13 ] | ||||
Sorry, that's not the kind of case which we investigate on users' machines, at least not at this point. | ||||
| Comment by Philip orleans [ 2020-04-14 ] | ||||
|
I misunderstood, I thought you needed the SQL DDL of my user-database, On Mon, Apr 13, 2020 at 6:59 PM Elena Stepanova (Jira) <jira@mariadb.org> | ||||
| Comment by Philip orleans [ 2020-04-15 ] | ||||
|
I need somebody to post the exact command to dump the MySQL schema. | ||||
| Comment by Elena Stepanova [ 2020-05-01 ] | ||||
|
Along with the resulting 1.dump, please also paste or attach your configuration file(s). If the problem were generic, we would have had thousands of reports about it. Currently this is the only one, so there must be something specific to your database or configuration (I suppose we can rule out environment, if it's reproducible for you on all machines). | ||||
| Comment by Elena Stepanova [ 2020-05-21 ] | ||||
|
Thanks for the dump. You must have had this database from around 10.1 or so. At least by doing it this way (altering the tables to MyISAM on 10.1 and then running upgrade on any higher version), I get the same error. The line numbers differ depending on the version, with 10.4 it matches yours exactly.
The failing statement is this:
What I couldn't quite figure out is where mysql.innodb_index_stats table disappeared after the upgrade, as it isn't present in your dump. Another table, mysql.innodb_table_stats, is there, and it is indeed MyISAM, but innodb_index_stats, which causes the failure, isn't there at all. Maybe it disappeared during further failed attempts to upgrade, or maybe you dropped it later. You should have seen this error in 10.2 already, but maybe you ran upgrade without InnoDB. And 10.3 apparently skipped mysql_upgrade, otherwise you wouldn't have the error about mysql.proc in the log on 10.4. So mainly it's an issue of the customized configuration. But I want to keep this report open, because after dealing with it, there are at least two complaints I fully agree with.
So, I'm going to modify the summary of this bug to indicate that it's about mysql_upgrade failing without proper diagnostics. For resolving the original issue, once you decide to customize you system tables, you have to stay consistent about it. In this case, inconsistency was in changing InnoDB-specific tables to MyISAM rather than dropping them, and then switching InnoDB back on. I think it's rather fortunate that it complained so early, I don't even know how InnoDB would behave when its system tables turned out to be outside the engine. | ||||
| Comment by Philip orleans [ 2020-05-22 ] | ||||
|
Dear Elena | ||||
| Comment by Marko Mäkelä [ 2021-09-17 ] | ||||
|
philip_38, I think that the InnoDB persistent statistics tables were a mistake that was made in MySQL 5.6. In MariaDB Server 10.6.5, I hope that in some future, we will be able to deprecate and remove the InnoDB internal statistics. To my understanding, that would require making the construction of engine-independent statistics more efficient. | ||||
| Comment by Philip orleans [ 2021-09-18 ] | ||||
|
Question: I could find a way to fix this in Google. I erased by mistake the directory '#rocksdb', and now I have all the *.frm. I don't care about the data, but I want to recover the create table definitions from the *.frm. Is there a way? I plain Mysql there was a utility but it depends on the full server been installed. Does MariaDB offers any way to recreate the table structure from a *.from (Rocksdb) | ||||
| Comment by Sergei Golubchik [ 2021-09-18 ] | ||||
|
philip_38, we don't have such a tool, although it should be possible to write one rather easily. What you can do now is to select from information_schema tables. Depending on what columns you select, it will or won't work with frm files only. For example, these two queries will work:
But two remaining columns from information_schema.statistics will not work. I believe these two queries as above should be enough to reconstruct all columns and indexes, though. |