Bug 348491 - Multiple MySQL table structure errors
Summary: Multiple MySQL table structure errors
Status: RESOLVED WORKSFORME
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: 1.13.0
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-31 10:22 UTC by Peter Humphrey
Modified: 2015-11-13 11:07 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
akonadictl start output (24.36 KB, text/plain)
2015-11-11 11:05 UTC, Peter Humphrey
Details
.local/share/akonadi/db_data/mysql.err (7.62 KB, text/plain)
2015-11-11 11:07 UTC, Peter Humphrey
Details
grep akonadi .xsession-errors (17.49 KB, text/plain)
2015-11-11 11:19 UTC, Peter Humphrey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Humphrey 2015-05-31 10:22:06 UTC
After creating a new user and setting up KMail-2, but before importing KMail-2 messages from an archive made by the previous user, ~/.local/share/akonadi/db_data/mysql.err contains many table structure errors.

Reproducible: Always




$ cat .local/share/akonadi/db_data/mysql.err
2015-05-31 10:29:55 7f1ee1fab740 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
150531 10:29:55 [Note] InnoDB: Using mutexes to ref count buffer pool pages
150531 10:29:55 [Note] InnoDB: The InnoDB memory heap is disabled
150531 10:29:55 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
150531 10:29:55 [Note] InnoDB: Memory barrier is not used
150531 10:29:55 [Note] InnoDB: Compressed tables use zlib 1.2.8
150531 10:29:55 [Note] InnoDB: Using Linux native AIO
150531 10:29:55 [Note] InnoDB: Using CPU crc32 instructions
150531 10:29:55 [Note] InnoDB: Initializing buffer pool, size = 80.0M
150531 10:29:55 [Note] InnoDB: Completed initialization of buffer pool
150531 10:29:55 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
150531 10:29:55 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
150531 10:29:55 [Note] InnoDB: Database physically writes the file full: wait...
150531 10:29:55 [Note] InnoDB: Setting log file ./ib_logfile101 size to 64 MB
150531 10:29:56 [Note] InnoDB: Setting log file ./ib_logfile1 size to 64 MB
150531 10:29:56 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
150531 10:29:56 [Warning] InnoDB: New log files created, LSN=45781
150531 10:29:56 [Note] InnoDB: Doublewrite buffer not found: creating new
150531 10:29:56 [Note] InnoDB: Doublewrite buffer created
150531 10:29:56 [Note] InnoDB: 128 rollback segment(s) are active.
150531 10:29:56 [Warning] InnoDB: Creating foreign key constraint system tables.
150531 10:29:56 [Note] InnoDB: Foreign key constraint system tables created
150531 10:29:56 [Note] InnoDB: Creating tablespace and datafile system tables.
150531 10:29:56 [Note] InnoDB: Tablespace and datafile system tables created.
150531 10:29:56 [Note] InnoDB: Waiting for purge to start
150531 10:29:56 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.23-72.1 started; log sequence number 0
150531 10:29:56 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
150531 10:29:56 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
150531 10:29:56 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_host_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_user_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_account_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'host_cache' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'objects_summary_global_by_type' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'setup_actors' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'setup_objects' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'table_io_waits_summary_by_index_usage' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'table_io_waits_summary_by_table' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'table_lock_waits_summary_by_table' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_stages_current' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_stages_history' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_stages_history_long' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_thread_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_account_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_user_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_host_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_stages_summary_global_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_current' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_history' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_history_long' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_thread_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_account_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_user_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_host_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_summary_global_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_digest' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'users' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'accounts' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'hosts' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'socket_instances' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'socket_summary_by_instance' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'socket_summary_by_event_name' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'session_connect_attrs' has the wrong structure
150531 10:29:56 [ERROR] Native table 'performance_schema'.'session_account_connect_attrs' has the wrong structure
150531 10:29:56 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
150531 10:29:56 [Note] Reading of all Master_info entries succeded
150531 10:29:56 [Note] Added new Master_info '' to hash table
150531 10:29:56 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.0.19-MariaDB'  socket: '/tmp/akonadi-prh.GWFNGt/mysql.socket'  port: 0  Source distribution
2015-05-31 10:29:56 7f1ee1e80700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."collectiontable" index "CollectionTable_parentAndNameIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."collectiontable" index "CollectionTable_enabledIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."collectiontable" index "CollectionTable_syncPrefIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."collectiontable" index "CollectionTable_displayPrefIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."collectiontable" index "CollectionTable_indexPrefIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."pimitemtable" index "PimItemTable_collectionIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."pimitemtable" index "PimItemTable_gidIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."pimitemtable" index "PimItemTable_ridIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."parttypetable" index "PartTypeTable_partTypeNameIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."parttable" index "PartTable_pimItemIdTypeIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."collectionattributetable" index "CollectionAttributeTable_collectionIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2015-05-31 10:29:57 7f1ee1e80700 InnoDB: Recalculation of persistent statistics requested for table "akonadi"."tagattributetable" index "TagAttributeTable_tagIndex" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
150531 10:53:54 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction
150531 10:53:54 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction
150531 10:53:54 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction
150531 10:53:54 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction
150531 10:53:54 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction
150531 10:53:54 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction
150531 10:54:57 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction
150531 10:54:57 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction
Comment 1 Martin Steigerwald 2015-11-11 08:12:04 UTC
Hello Peter, thank you for your report. I have no idea what it can be, but I ask some questions:

1) Is this really a new user, i.e. means ~/.config/akonadi and ~/.local/share/akonadi and ~/.kde/share/config/akonadi* do not exist?

2) Are you sure that only one mysqld is running? I have seen it several times that after an akonadictl stop mysqld was not stopped properly at least not within a minute. When doing an akonadictl start while old mysqld is running, it unfortunately starts another. I ask due to:

150531 10:54:57 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction

But there is another message about another mysqld running missing from the log.

3) Are you positive that your filesystem is 100% clean? Review syslog/messages log and/or dmesg for any errors of the filesystem and any errors of the underlying backend storage. Please do an fsck -N (no modify, read only mode) on the unmounted filesystem as well, just to make sure it is intact. Please also state what filesystem type / device the Akonadi stuff is located on.

4) When you start akonadi on a terminal with akonadictl start do you see any additional messages or errors? You may also review ~/.xsession-errors for any additional errors.

5) Any errors in ~/local/share/akonadi/akonadiserver.error and/or akonadi_control.error?

6) Last also: Did you do a MySQL upgrade between creating the user and starting Akonadi for the first time (thus creating the database) and your import of old mails? If so, it may be needed to run mysql_upgrade on the database. I ask due to:

150531 10:29:56 [ERROR] Native table 'performance_schema'.'events_statements_current' has the wrong structure


Also what exact patch release of Akonadi 1.13 is it? Does it contain any of the performance related improvements from Akonadi 1.13 git branch? I have used them for a long time, but the Debian developer who packaged 1.13 had issues with it. Also please state what version of KDEPIM you use on top on Akonadi.

You may also want to try with Akonadi 15.08 or even later, but you need Qt 5 based KDEPIM for that as well, so also Plasma 5 instead of KDE SC 4.14/4.11 stuff. I have KDEPIM/Akonadi running from git master together with MariaDB 10 and mysql.err is clean.
Comment 2 Martin Steigerwald 2015-11-11 08:13:15 UTC
Oh, I now found you reported it in May already. So in case that issue was interim and is fixed meanwhile, please state so, so I can close the bug.

Sorry for taking long time to reply to bug report. The KDEPIM team needs more people to do bug triaging.
Comment 3 Peter Humphrey 2015-11-11 11:05:07 UTC
Created attachment 95433 [details]
akonadictl start output
Comment 4 Peter Humphrey 2015-11-11 11:07:23 UTC
Created attachment 95434 [details]
.local/share/akonadi/db_data/mysql.err
Comment 5 Peter Humphrey 2015-11-11 11:19:53 UTC
Created attachment 95435 [details]
grep akonadi .xsession-errors
Comment 6 Peter Humphrey 2015-11-11 12:00:28 UTC
Hello Martin,

Thanks for your reply - with its long list of questions!

0.  First, I don't have any other PIM components installed than KMail - could all these errors be caused by not having a more complete set of programs? My machine runs Gentoo stable. It has two 1TB SSDs (Crucial) arranged in RAID-1 using mdadm, and all my user stuff is in /dev/md7 (ext4) which is on /dev/sd[ab]7. I've just rebooted without another MySQL instance running and with a clean .xsession-errors.

1.  I was having various problems with KMail at the time, which were fixed temporarily by archiving all my mails, creating a new user, importing the mails and thus starting again. I mentioned the new user to show that I was starting with a clean slate.

2.  I did have MySQL starting at boot time as a general service. I've discontinued that now to avoid red herrings here.

3.  I've run fsck many times, and I'm sure the file-systems are as clean as I can get them.

4.  See attached files.

5.  akonadiserver.error and akonadi_control.error don't exist here.

6.  MySQL has been at version 5.6.27 ever since it became available in Gentoo stable.

This is the history of akonadi. My record only goes back to June, as you see:
$ genlop akonadi-server
 * app-office/akonadi-server
     Mon Jun 29 15:45:10 2015 >>> app-office/akonadi-server-1.13.0
     Fri Aug  7 09:08:25 2015 >>> app-office/akonadi-server-1.13.0-r1
     Sun Oct 25 08:56:49 2015 >>> app-office/akonadi-server-1.13.0-r2

No higher versions are available in Gentoo. I've built a separate, experimental KDE system using Qt-5 and the Gentoo plasma profile and kde overlay. Do you want me to do some more testing in that system? It still has the same version of akonadi-server though. I could install the whole of KDE-PIM in that system in a few days' time, once the overlay is consistent again.
Comment 7 Martin Steigerwald 2015-11-11 13:44:38 UTC
Peter, I reviewed your files. I have no clue at whats happening here.

Basically if you really start without ~/.local/share/akonadi and ~/.config/akonadi directories, i.e. clean from scratch, Akonadi starts a new mysqld from and creates the database from scratch.

I am not sure whether your logs reflect that state. Maybe redo the logs with the following conditions:

- akonadictl stop
- make sure mysqld process is gone
- remove or move away ~/.config/akonadi
- remove or move away ~/.local/share/akonadi
- remove or move away ~/.kde/share/config/akonadi* (and maybe even kmail*rc)
- akonadictl start on console: Capture output of it.
- look whether mysql.err exists and include it exactly in the state after the first start of Akonadi after you removed everything

According to trying with newer versions: You can try. But then I´d recommend to use at least KDEPIM and Akonadi 15.08.

That said, Debian Jessie has 1.13 with *some, but not all* of the newer performance related patches after last release of 1.13 from the git 1.13 branch of Akonadi. As said, the maintainer who made the 1.13 patches had issues with some of the patches after the last release of 1.13.

That said the performance table is a MySQL specific thing. So I wonder how it can have the wrong structure. Thats all I can come up with for now. Good luck.
Comment 8 Peter Humphrey 2015-11-12 16:19:49 UTC
Well, that's odd.  I've just gone through the whole process of creating a new user account and importing the mail archive from the old one - and now I don't get any errors at all!

Well, I did get 10 instances of this during the import process:
 [ERROR] mysqld: Deadlock found when trying to get lock; try restarting transaction
but nothing since then.

It looks as though the problem has been fixed. It must have been hiding in the data somehow, though I can't imagine how. Anyway, do feel free to close the bug, Martin. Thanks for your time - and apologies for wasting it!
Comment 9 Martin Steigerwald 2015-11-13 11:07:31 UTC
Thanks. Closing.

To me this deadlock thing still hints at that at some time two mysqld has been running. Well if it works for you now, all the better. Feel free to reopen if you see this again.
Comment 10 Martin Steigerwald 2015-11-13 11:07:52 UTC
Sorry, I meant to close it.