maria-discuss team mailing list archive
-
maria-discuss team
-
Mailing list archive
-
Message #01219
Re: INSERT IGNORE (and other SQL commands) fail with: Deadlock found when trying to get lock;
-
To:
maria-discuss@xxxxxxxxxxxxxxxxxxx
-
From:
Benoit Panizzon <benoit.panizzon@xxxxxx>
-
Date:
Thu, 19 Dec 2013 09:36:46 +0100
-
In-reply-to:
<48433.ab065caa.1386889628.nsm@mail.trader-internet.dk>
-
Organization:
ImproWare AG
-
User-agent:
KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; )
Hi
> If memory serves me, the first timestamp, will be set
> to current universal time. Like db.table.last_changed
Ok, I replaced NOW() with a generated timestamp to avoid that NOW() deadlock.
sub mysql_now() {
my($sec,$min,$hour,$mday,$mon,$year,$wday, $yday,
$isdst)=localtime(time);
my($result)=sprintf("%4d-%02d-%02d %02d:%02d:%02d",$year+1900,$mon+1,
$mday,$hour,$min,$sec);
return $result;
}
[...]
my $mysqltimestamp = mysql_now();
my $timestamph = $dbh->prepare("UPDATE user SET lastActive = ". $dbh-
>quote($mysqltimestamp) ." WHERE userid = ". $dbh->quote($user) ." and domain
= ". $dbh->quote($domain));
$timestamph->execute();
Still in about 1 of 10 updates, this causes that wrenched Deadlock error,
causing the email not being processed correctly and in the case the email is
not for local but being forwarded, the email is not forwarded to the correct
destination.
Dec 18 14:12:34 asterix mimedefang-multiplexor[8019]: NOQUEUE: Slave 0 stderr:
DBD::mysql::st execute failed: Deadlock found when trying to get lock; try
restarting transaction at /etc/mimedefang-filter.mx line 316.
Is there any known way to circumvent that Deadlock Problem?
Kind regards
Benoit Panizzon
--
I m p r o W a r e A G -
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 07
CH-4133 Pratteln Fax +41 61 826 93 02
Schweiz Web http://www.imp.ch
______________________________________________________
Follow ups
References