[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1010576: (no subject)



It seems to me that indeed akonadiserver is the culprit. I kept kontact 
running and only stopped akonadiserver, killed mariadb and resarted 
akonadiserver. Then kontact started to work again.

More info: I suspect that this is due to a deadlock in the db updates, 
akonadiserver even logs this:
org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try 
restarting transaction QMYSQL3: Der Befehl konnte nicht ausgeführt werden"

So I had a look at mariadb like this:
mysql --socket=/run/user/1000/akonadi/mysql.socket

MariaDB [(none)]> show engine innodb status;
[...]
------------------------
LATEST DETECTED DEADLOCK
------------------------
2022-06-13 07:24:55 0x7f8a1c681640
*** (1) TRANSACTION:
TRANSACTION 78342, ACTIVE 0 sec starting index read
mysql tables in use 6, locked 6
LOCK WAIT 6 lock struct(s), heap size 1128, 3 row lock(s), undo log entries 1
MariaDB thread id 41, OS thread handle 140231158797888, query id 165472 
localhost user Updating
UPDATE PimItemTable SET rev = ?, remoteId = ?, remoteRevision = ?, gid = ?, 
collectionId = ?, mimeTypeId = ?, datetime = ?, atime = ?, dirty = ?, size = ? 
WHERE ( id = ? )
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 9 page no 3493 n bits 1080 index 
PimItemTable_idSortIndex of table `akonadi`.`pimitemtable` trx id 78342 
lock_mode X locks rec but not gap waiting
Record lock, heap no 855 PHYSICAL RECORD: n_fields 1; compact format; info 
bits 0
 0: len 8; hex 800000000004cb8d; asc         ;;

*** CONFLICTING WITH:
RECORD LOCKS space id 9 page no 3493 n bits 1080 index 
PimItemTable_idSortIndex of table `akonadi`.`pimitemtable` trx id 78344 
lock_mode X locks rec but not gap
Record lock, heap no 855 PHYSICAL RECORD: n_fields 1; compact format; info 
bits 0
 0: len 8; hex 800000000004cb8d; asc         ;;


*** (2) TRANSACTION:
TRANSACTION 78344, ACTIVE 0 sec starting index read
mysql tables in use 6, locked 6
LOCK WAIT 3 lock struct(s), heap size 1128, 2 row lock(s)
MariaDB thread id 40, OS thread handle 140231159105088, query id 165015 
localhost user Updating
UPDATE PimItemTable SET atime = ? WHERE ( ( PimItemTable.id = ? ) )
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 9 page no 3872 n bits 208 index PRIMARY of table 
`akonadi`.`pimitemtable` trx id 78344 lock_mode X locks rec but not gap 
waiting
Record lock, heap no 169 PHYSICAL RECORD: n_fields 13; compact format; info 
bits 0
 0: len 8; hex 800000000004cb8d; asc         ;;
 1: len 6; hex 000000013205; asc     2 ;;
 2: len 7; hex 730000080d03f1; asc s      ;;
 3: len 4; hex 80000001; asc     ;;
 4: len 5; hex 3834383038; asc 84808;;
 5: SQL NULL;
 6: SQL NULL;
 7: len 8; hex 8000000000000028; asc        (;;
 8: len 8; hex 8000000000000005; asc         ;;
 9: len 4; hex 62a6ae07; asc b   ;;
 10: len 4; hex 62a6ae07; asc b   ;;
 11: len 1; hex 80; asc  ;;
 12: len 8; hex 8000000000005f14; asc       _ ;;

*** CONFLICTING WITH:
RECORD LOCKS space id 9 page no 3872 n bits 208 index PRIMARY of table 
`akonadi`.`pimitemtable` trx id 78342 lock_mode X locks rec but not gap
Record lock, heap no 169 PHYSICAL RECORD: n_fields 13; compact format; info 
bits 0
 0: len 8; hex 800000000004cb8d; asc         ;;
 1: len 6; hex 000000013205; asc     2 ;;
 2: len 7; hex 730000080d03f1; asc s      ;;
 3: len 4; hex 80000001; asc     ;;
 4: len 5; hex 3834383038; asc 84808;;
 5: SQL NULL;
 6: SQL NULL;
 7: len 8; hex 8000000000000028; asc        (;;
 8: len 8; hex 8000000000000005; asc         ;;
 9: len 4; hex 62a6ae07; asc b   ;;
 10: len 4; hex 62a6ae07; asc b   ;;
 11: len 1; hex 80; asc  ;;
 12: len 8; hex 8000000000005f14; asc       _ ;;

*** WE ROLL BACK TRANSACTION (0)
------------
TRANSACTIONS
------------
Trx id counter 78442
Purge done for trx's n:o < 78439 undo n:o < 0 state: running but idle
History list length 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 78441, ACTIVE 2344 sec inserting
mysql tables in use 1, locked 1
8 lock struct(s), heap size 1128, 4 row lock(s), undo log entries 427
MariaDB thread id 47, OS thread handle 140231558207040, query id 233232 
localhost user Update
INSERT INTO PimItemTable (rev, remoteId, remoteRevision, gid, collectionId, 
mimeTypeId, datetime, atime, dirty, size) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 
?)
---TRANSACTION (0x7f8a422bcd80), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION (0x7f8a422a4c80), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION (0x7f8a422a4180), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION (0x7f8a422a3680), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
---TRANSACTION (0x7f8a422a2b80), not started
0 lock struct(s), heap size 1128, 0 row lock(s)
--------



And:
MariaDB [(none)]> show full processlist;
+----+------+-----------+---------+---------+------+----------
+-------------------------------------------------------------------------------------------------------------------------------------------------------------
+----------+
| Id | User | Host      | db      | Command | Time | State    | Info                                                                                                                                                        
| Progress |
+----+------+-----------+---------+---------+------+----------
+-------------------------------------------------------------------------------------------------------------------------------------------------------------
+----------+
|  5 | user  | localhost | akonadi | Sleep   | 3145 |          | NULL                                                                                                                                                        
|    0.000 |
|  6 | user  | localhost | akonadi | Sleep   |  142 |          | NULL                                                                                                                                                        
|    0.000 |
|  7 | user  | localhost | akonadi | Sleep   |  145 |          | NULL                                                                                                                                                        
|    0.000 |
|  8 | user  | localhost | akonadi | Sleep   | 3133 |          | NULL                                                                                                                                                        
|    0.000 |
| 43 | user  | localhost | akonadi | Sleep   | 1949 |          | NULL                                                                                                                                                        
|    0.000 |
| 47 | user  | localhost | akonadi | Execute | 2023 | Update   | INSERT INTO 
PimItemTable (rev, remoteId, remoteRevision, gid, collectionId, mimeTypeId, 
datetime, atime, dirty, size) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) |    0.000 
|
| 53 | user  | localhost | NULL    | Query   |    0 | starting | show full 
processlist                                                                                                                                       
|    0.000 |
+----+------+-----------+---------+---------+------+----------
+-------------------------------------------------------------------------------------------------------------------------------------------------------------
+----------+
7 rows in set (0.000 sec)

MariaDB [(none)]> show open tables where In_Use > 0 ;
+----------+--------------+--------+-------------+
| Database | Table        | In_use | Name_locked |
+----------+--------------+--------+-------------+
| akonadi  | pimitemtable |      1 |           0 |
+----------+--------------+--------+-------------+
1 row in set (0.001 sec)


So does anyone have an idea why the insert statement does not finish?


Reply to: