PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > InnoDB table which would not unlock
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
InnoDB table which would not unlock

Réponse
 
LinkBack Outils de la discussion
Vieux 12/12/2007, 13h14   #1
Ben Clewett
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut InnoDB table which would not unlock

Dear MySql,

Using 5.0.41 I had a single innodb table which would not unlock. I
wonder if this might be a bug, or an issue that is known to be fixed in
later versions?

Any DML like this example:

UPDATE ws_queue SET stage = 'committed' WHERE stage = 'running'

Would result in:

ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

However there were no visible locks:

show open tables like 'ws_queue';
+-------------+------------------+--------+-------------+
| Database | Table | In_use | Name_locked |
+-------------+------------------+--------+-------------+
| Web_Members | ws_queue | 0 | 0 |
+-------------+------------------+--------+-------------+

This seems to be an error, and was fixed by bouncing the server,
something I do not like doing in the middle of a working day.

At the time Innodb status showed the following. Can any person me
understand what this is telling me?

---TRANSACTION 0 3683516087, ACTIVE 6 sec, process no 18537, OS thread
id 1149135168 starting index read
mysql tables in use 1, locked 1
LOCK WAIT 3 lock struct(s), heap size 1216
MySQL thread id 2738280, query id 50900786 172.16.16.39 dba Updating
UPDATE ws_queue SET stage = 'committed' WHERE stage = 'running'
------- TRX HAS BEEN WAITING 40 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 5619722 n bits 240 index `PRIMARY` of
table `Web_Members/ws_queue` trx id 0 3683516087 lock_mode X waiting
Record lock, heap no 5 PHYSICAL RECORD: n_fields 20; compact format;
info bits 0
0: len 4; hex 0002b3f8; asc ;; 1: len 6; hex 0000db8363ad; asc
c ;; 2: len 7; hex 00001a87d72205; asc " ;; 3: len 1; hex 80; asc
;; 4: len 1; hex 01; asc ;; 5: len 4; hex 475fbf76; asc G_ v;; 6: len
7; hex 63685f61637473; asc ch_acts;; 7: len 8; hex 3236434539424134; asc
26CE9BA4;; 8: len 8; hex 0000000000107523; asc u#;; 9: len 4; hex
80000000; asc ;; 10: len 8; hex 4a414d455349524c; asc JAMESIRL;; 11:
len 4; hex 800086bc; asc ;; 12: len 0; hex ; asc ;; 13: len 0; hex ;
asc ;; 14: SQL NULL; 15: len 4; hex 80000000; asc ;; 16: len 4; hex
80000001; asc ;; 17: len 1; hex 80; asc ;; 18: len 4; hex 64626d73;
asc dbms;; 19: len 1; hex 00; asc ;;

Regards,

Ben Clewett.



  Réponse avec citation
Vieux 12/12/2007, 23h09   #2
Baron Schwartz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: InnoDB table which would not unlock

Hi Ben,

On Dec 12, 2007 8:14 AM, Ben Clewett <ben@clewett.org.uk> wrote:
> Dear MySql,
>
> Using 5.0.41 I had a single innodb table which would not unlock. I
> wonder if this might be a bug, or an issue that is known to be fixed in
> later versions?
>
> Any DML like this example:
>
> UPDATE ws_queue SET stage = 'committed' WHERE stage = 'running'
>
> Would result in:
>
> ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
>
> However there were no visible locks:
>
> show open tables like 'ws_queue';
> +-------------+------------------+--------+-------------+
> | Database | Table | In_use | Name_locked |
> +-------------+------------------+--------+-------------+
> | Web_Members | ws_queue | 0 | 0 |
> +-------------+------------------+--------+-------------+
>
> This seems to be an error, and was fixed by bouncing the server,
> something I do not like doing in the middle of a working day.
>
> At the time Innodb status showed the following. Can any person me
> understand what this is telling me?
>
> ---TRANSACTION 0 3683516087, ACTIVE 6 sec, process no 18537, OS thread
> id 1149135168 starting index read
> mysql tables in use 1, locked 1
> LOCK WAIT 3 lock struct(s), heap size 1216
> MySQL thread id 2738280, query id 50900786 172.16.16.39 dba Updating
> UPDATE ws_queue SET stage = 'committed' WHERE stage = 'running'
> ------- TRX HAS BEEN WAITING 40 SEC FOR THIS LOCK TO BE GRANTED:
> RECORD LOCKS space id 0 page no 5619722 n bits 240 index `PRIMARY` of
> table `Web_Members/ws_queue` trx id 0 3683516087 lock_mode X waiting
> Record lock, heap no 5 PHYSICAL RECORD: n_fields 20; compact format;
> info bits 0
> 0: len 4; hex 0002b3f8; asc ;; 1: len 6; hex 0000db8363ad; asc
> c ;; 2: len 7; hex 00001a87d72205; asc " ;; 3: len 1; hex 80; asc
> ;; 4: len 1; hex 01; asc ;; 5: len 4; hex 475fbf76; asc G_ v;; 6: len
> 7; hex 63685f61637473; asc ch_acts;; 7: len 8; hex 3236434539424134; asc
> 26CE9BA4;; 8: len 8; hex 0000000000107523; asc u#;; 9: len 4; hex
> 80000000; asc ;; 10: len 8; hex 4a414d455349524c; asc JAMESIRL;; 11:
> len 4; hex 800086bc; asc ;; 12: len 0; hex ; asc ;; 13: len 0; hex ;
> asc ;; 14: SQL NULL; 15: len 4; hex 80000000; asc ;; 16: len 4; hex
> 80000001; asc ;; 17: len 1; hex 80; asc ;; 18: len 4; hex 64626d73;
> asc dbms;; 19: len 1; hex 00; asc ;;


The SHOW OPEN TABLES statement isn't going to show you anything
relevant here, because the lock is on the InnoDB level, not the MySQL
server level. The server is unaware of storage-engine locks.

Another transaction had the record locked. The transaction needed to
commit or rollback to release the locks. You can see locks held (as
opposed to locks waited for) by using the InnoDB lock monitor, or via
a patch I created.

http://www.xaprb.com/blog/2007/09/18...db-lock-waits/
http://bugs.mysql.com/bug.php?id=29126

You may also find innotop (http://innotop.sourceforge.net/) ful.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h00.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11413 seconds with 10 queries