+1<div><br></div><div>The error is the actual MySQL error, so yes it's definitely a lock timeout.</div><div><br></div><div>This means two different queries were trying to access the same data at the same time. Normally one'll wait until the other is finished, but if it waits too long you get the lock timeout error.</div>
<div><br></div><div>It can be caused by a query taking too long, or a transaction modifying the data but then taking too long before commit. To avoid that make sure MySQL is tuned correctly. Good indexes on the tables and good sizes for the cache buffers.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Make sure you're using a proper index for the delete operation, I'd also avoid ORs if possible.</blockquote>
<div><br></div><div>The query is part of mod_sofia, so isn't modifiable. Having a KEY(hostname,expires) on sip_dialogs may help though if it doesn't already exist (check with SHOW CREATE TABLE sip_dialogs).</div>
<div>
<br></div><div>Avoid accessing sip_dialogs from any of your own code to minimise the number of things that might block each other.</div><div><br></div><div>-Steve</div><div><br></div><div><br><br><div class="gmail_quote">
On 16 July 2013 06:48, Rafal Gwizdala <span dir="ltr"><<a href="mailto:rafal.gwizdala@gmail.com" target="_blank">rafal.gwizdala@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I'd bet this is a lock timeout, caused by database operation taking too long.<div>Make sure you're using a proper index for the delete operation, I'd also avoid ORs if possible.</div><div>R</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Jul 16, 2013 at 4:21 AM, Lloyd Aloysius <span dir="ltr"><<a href="mailto:lloyd.aloysius@gmail.com" target="_blank">lloyd.aloysius@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><font face="verdana,sans-serif">Hi,</font><div><font face="verdana,sans-serif"><br></font></div>
<div><font face="verdana,sans-serif">I got the following error</font></div>
<div><font face="verdana,sans-serif"><br></font></div>
<div><font face="verdana,sans-serif"><div>2013-07-15 21:47:<a href="tel:41.061450" value="+4841061450" target="_blank">41.061450</a> [ERR] switch_odbc.c:514 ERR: [delete from sip_dialogs where (expires = -1 or (expires > 0 and expires <= 1373939087)) and hostname='<a href="http://mydomain.com" target="_blank">mydomain.com</a>']</div>
<div>[STATE: HY000 CODE 1205 ERROR: [unixODBC][MySQL][ODBC 5.1 Driver][mysqld-5.5.32]Lock wait timeout exceeded; try restarting transaction]</div></font><div><br></div><div>and the odbcinst.ini</div><div><br></div><div><div>
[MySQL]</div><div>Description = ODBC for MySQL</div><div>Driver = /usr/lib/libmyodbc5.so</div><div>Setup = /usr/lib/libodbcmyS.so</div><div>Driver64 = /usr/lib64/libmyodbc5.so</div><div>Setup64 = /usr/lib64/libodbcmyS.so</div>
<div>FileUsage = 1</div><div>Threading = 0</div><div>UsageCount = 1</div></div><div><br></div><div>This is a mysql memory leak? How can fix this error?</div><div><br></div><div>DB Server running with 24 GB memory and 2 Quad Core Xeon</div>
<div><br></div><div><br></div><div>Thanks</div><span><font color="#888888"><div>Lloyd</div>
</font></span></div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>