[MDEV-29921] Mariadb segv in acl_reload in start after upgrade Created: 2022-10-31 Updated: 2022-11-02 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Upgrades |
| Affects Version/s: | 10.7.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Michal Vymazal | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | crash | ||
| Environment: |
Ubuntu server 22.04 LTS 64 bit AMD |
||
| Attachments: |
|
| Description |
|
ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=dumped, signal=SEGV) |
| Comments |
| Comment by Daniel Black [ 2022-10-31 ] | ||||||||
|
michal25, What was the previous version you where using? What was the original version where the datadir was created? Are you running mysql_upgrade/mariadb_upgrade? Do you have any special authentication configurations? The crash is loading from the authentication table. Can you perform the following to get more information:
| ||||||||
| Comment by Michal Vymazal [ 2022-10-31 ] | ||||||||
|
Previous version 10.3.34 (Ubuntu 20.04 server, LTS 64 bit AMD). Worked fine. Original version - somewhere on Ubuntu 16.04 | ||||||||
| Comment by Elena Stepanova [ 2022-10-31 ] | ||||||||
|
Do you have a log from the very first crash? Or better yet, the last 10.3 session, shutdown, and 10.7 startup with the crash. | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
Last function log with the 10.3.34 version and last functionaly mysql config file. I'm going to proceed the | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
I had to use this script and repository to correctly install Mariadb 10.7 curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup Here is the output:
For help, type "help". | ||||||||
| Comment by Elena Stepanova [ 2022-11-01 ] | ||||||||
Thanks. What about the very first crash on 10.7? As we can see, 10.3 log error.log
but 10.7 log mariadb-err.txt
If there is a crash recovery, there must have been a crash at some point between 14:41 and 22:07. Probably there were a number of crashes, but the first one should have occurred without crash recovery, upon or after a normal startup. It could have happened right during the upgrade process, under the hood, but there should still be a log of it. | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
Can I ask for some ideas how to repair the crash? I have backup for all databases, but the clean install if mariadb and database restore will take more time. And this crash can occure again. I only made the ragular OS upgrade (from console) from ubuntu server 20.04 LTS 64 bit AMD to ubuntu 22.04 64 bit AMD and this mariadb crash is the result. | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
I did not find more logs. It looks that the upgrade process stopped the rsyslogd daemon. I had to restart it after upgrade. | ||||||||
| Comment by Elena Stepanova [ 2022-11-01 ] | ||||||||
It's difficult (and somewhat dangerous) to give advice blindly, but maybe you could try to run myisamchk or aria_chk on your system tables, those in mysql schema (the choice of the tool depends on whether they are still MyISAM as they came from 10.3, or they got converted to Aria already, as Ubuntu installation could have run mysql_upgrade automatically without your knowing it). If the check reveals any problems, you could try to do repair. Alternatively, you can try to start the server with -skip-grant-tables and, if it starts, to look around, run CHECK TABLE .. EXTENDED on system tables and REPAIR if needed. It's possible that you may lose some contents of system tables upon repair, but if you have a backup, you can later take the lost data from it, only in system tables, it shouldn't take as long as restoring the whole instance. | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
I found the log in /var/log/daemon.log (stupid rsyslogd). I will post it. Here is the log with crash of mariadb 10.6.7 after upgrade from Ubuntu server 20.04 to ubuntu server 22.04. Previous version of mariadb was 10.3 and worked fine. mariadb-daemon.log | ||||||||
| Comment by Elena Stepanova [ 2022-11-01 ] | ||||||||
|
Thanks. So, it failed on 10.6.7 already, and the original crash was the same as subsequent ones, in
(10.6.7-MariaDB-2ubuntu1.1 is MariaDB server built by Ubuntu and coming from Ubuntu repos, even though the suffix looks odd). I've tried the whole routine – installing 10.3 on Ubuntu 20.04 and upgrading to Ubuntu 22.04 which pulls 10.6.7 with it, – but didn't get a crash, it upgraded seemingly all right. So, it's not just the upgrade as such, either something specific to the data or to the environment. I assume you've checked your disks and system logs for signs of corruption and other hardware failures? | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
Server HW looks OK. It looks to corrupted InnoDB files. At this moment I trying included in local configuration file Value 1 in innodb-force-recovery had no effect. | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
Bad luck Has no effect. | ||||||||
| Comment by Elena Stepanova [ 2022-11-01 ] | ||||||||
|
InnoDB may have corrupt tables (especially if a massive corruption occurred on whatever reason), but it is unlikely to be the cause of failing acl load – unless of course you previously converted system tables to InnoDB, which some people do. Did you try to run check on system tables? | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
But how? ~# mysqlcheck --all-databases | ||||||||
| Comment by Elena Stepanova [ 2022-11-01 ] | ||||||||
|
As said in the comment above – not mysqlcheck, but myisamchk or aria_chk (depending on whether the tables are MYD/MYI or MAD/MAI). These tools work with on-disk files, not with the running database instance. | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
You re right And .... lis 01 18:00:47 snehurka mariadbd[364485]: 2022-11-01 18:00:47 0 [Note] Plugin 'FEEDBACK' is disabled. | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
I tried yesterday, but in another config section. I'm going to inspect the database. | ||||||||
| Comment by Michal Vymazal [ 2022-11-01 ] | ||||||||
|
Some tables have broken .frm files redmine.wiki_redirects The table exists on the filesystem. Any idea to repair? | ||||||||
| Comment by Michal Vymazal [ 2022-11-02 ] | ||||||||
|
The problem is partially solved. after this back to bash I had to (manualy) drop/erase each broken database, create the database again and fill it from the backup file. But, here is a problem with the "mysql" database which is a system file. And the drop/create/restore method will not work. Look at the attached file table-mysql.err How to repar? | ||||||||
| Comment by Elena Stepanova [ 2022-11-02 ] | ||||||||
|
The four broken system tables in the attachment are all InnoDB tables. Most likely they don't contain anything of the essence, unless you were running traditional replication based on GTID and/or had transaction-precision system-versioned tables. And statistics is probably outdated anyway. So, you can drop and re-create these tables. Upd: | ||||||||
| Comment by Michal Vymazal [ 2022-11-02 ] | ||||||||
|
Apologize I'm going to try to drop and recreate the 5 mysql broken tables. | ||||||||
| Comment by Michal Vymazal [ 2022-11-02 ] | ||||||||
|
Grrrrr. Can you help me, please? How to recreate a InnoDB table in the mysql database from the console? It works like this? CREATE TABLE t1 (a INT, b CHAR (20), PRIMARY KEY (a)) ENGINE=InnoDB; Thank you very much. | ||||||||
| Comment by Elena Stepanova [ 2022-11-02 ] | ||||||||
|
Yes, except that of course you should take the exact table definition for those system tables, to avoid further problems. | ||||||||
| Comment by Michal Vymazal [ 2022-11-02 ] | ||||||||
|
So, this way? | ||||||||
| Comment by Elena Stepanova [ 2022-11-02 ] | ||||||||
|
You need definitions from MariaDB 10.x (whichever x you are using now, 10.7 or 10.6 or something else). E.g. for 10.7 you can find them here https://github.com/MariaDB/server/blob/2092881984117b9e10b5d2afc8d387ec90199287/scripts/mysql_system_tables.sql , same idea for 10.6. The easier way could be after dropping the tables to re-run mysql_upgrade (with --force if necessary), it should re-create the missing tables. | ||||||||
| Comment by Michal Vymazal [ 2022-11-02 ] | ||||||||
|
Done, but with errors. | ||||||||
| Comment by Elena Stepanova [ 2022-11-02 ] | ||||||||
|
They didn't get dropped properly then. | ||||||||
| Comment by Michal Vymazal [ 2022-11-02 ] | ||||||||
|
mysql> flush tables; is not helping. But I can start the mariadb environment without the /etc/mysql/my.cnf Thank you very much! | ||||||||
| Comment by Michal Vymazal [ 2022-11-02 ] | ||||||||
|
SOLVED! systemctl stop mysql systemctl start mysql mysql_upgrade -u root -p --force Phase 4/7: Running 'mysql_fix_privilege_tables' Broken tables in /var/lib/mysql/mysql |