[ZBX-3889] MySQL InnoDB deadlocks are not handled and result in invalid action mail body Created: 2011 Jun 16  Updated: 2017 May 30  Resolved: 2011 Aug 10

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 1.8.6
Fix Version/s: 1.8.7, 1.9.5 (alpha)

Type: Incident report Priority: Critical
Reporter: dimir Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBX-1401 Zabbix_server continues failed transa... Closed
is duplicated by ZBX-1402 Zabbix_server creates deadlocks in tr... Closed
is duplicated by ZBX-2897 Zabbix eats up MySQL server connections Closed

 Description   

Sometimes when modifying data in MySQL a deadlock may occur:

zabbix_server.log: 24889:20110530:010220.231 [Z3005] Query failed: [1213] Deadlock found when trying to get lock; try restarting transaction [insert into escalations (escalationid,actionid,triggerid,eventid,status) values (200000000018794,200200000000025,200200000023706,200200019036833,0)]

this leads to "Duplicate primary key" errors

zabbix_server.log: 24800:20110530:011134.440 [Z3005] Query failed: [1062] Duplicate entry '200200019036927' for key 'PRIMARY' [insert into events (eventid,source,object,objectid,clock,ns,value) values (200200019036927,2,3,200200000000370,1306685494,0,1)]

The solution is to repeat these operations until they succeed.



 Comments   
Comment by dimir [ 2011 Jun 16 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-3889 .

Comment by dimir [ 2011 Jun 16 ]

REJECTED. We decided this is not the way to handle such errors because in most cases these errors involve transaction rollbacks.

Comment by dimir [ 2011 Jun 21 ]

Reopening to resolve.

Comment by dimir [ 2011 Jun 21 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-3889

In case of db error in event registration return immediately without processing actions.

Comment by Alexander Vladishev [ 2011 Jul 21 ]

Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-3889

Comment by hamid sfandiari [ 2011 Aug 04 ]

i installed a new 1.8.6rc.2 (revision 20861) in my lab and it hasn't any host , only it has 3 discovery rules with related action for adding discovered hosts into a group.
zabbix performance is to low and i see error like the following :

2080:20110804:092336.810 [Z3005] query failed: [1213] Deadlock found when trying to get lock; try restarting transaction [delete from escalations where escalationid=245]
2080:20110804:092406.807 [Z3005] query failed: [1213] Deadlock found when trying to get lock; try restarting transaction [delete from escalations where escalationid=258 and status=4]
2080:20110804:092502.809 [Z3005] query failed: [1213] Deadlock found when trying to get lock; try restarting transaction [delete from escalations where escalationid=282]

please help me

<rudolfs> This seems to be a different case, separated it into ZBX-4020.

Comment by hamid sfandiari [ 2011 Aug 04 ]

slow query log::

delete from escalations where actionid=4 and triggerid=0 and status not in (1,4,5) and (esc_step<>0 or status<>0);

with StartDiscoverers=10 in the config file

the problem doesn't appear when i use StartDiscoverers=1

<rudolfs> This seems to be a different case, separated it into ZBX-4020.

Comment by richlv [ 2011 Aug 09 ]

what's the current status here ?

Comment by hamid sfandiari [ 2011 Aug 10 ]

it seems that you had correct it like a ZABBIX-master

with StartDiscoverers=4
latest version 1.8.6

Comment by Rudolfs Kreicbergs [ 2011 Aug 10 ]

hamid, can you explain some more? is the problem gone? if so, please add a comment to ZBX-4020.

richlv, this ZBX may still need minor adjustments and is not fully tested yet.

Comment by Alexander Vladishev [ 2011 Aug 18 ]

Merged to trunk in the development branch svn://svn.zabbix.com/branches/dev/ZBX-3889-TRUNK

Comment by Alexander Vladishev [ 2011 Aug 20 ]

Fixed in the version pre1.8.7, r21259.

Generated at Fri Apr 19 09:40:57 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.