[ZBX-4158] Within transaction, SQL statements after failure are still processed Created: 2011 Sep 21  Updated: 2017 May 30  Resolved: 2012 Jan 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: None
Fix Version/s: 1.8.9, 1.9.8 (beta)

Type: Incident report Priority: Blocker
Reporter: dimir Assignee: dimir
Resolution: Fixed Votes: 0
Labels: db, transaction
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

 Description   

When in transaction and SQL statement fails the subsequent SQL statements within that transaction are still processed. This can result in data inconsistency.

Solution: for every execute and select statement if inside a failed transaction return without doing anything.



 Comments   
Comment by richlv [ 2011 Sep 21 ]

wasn't something similar fixed recently as ZBX-1401 ?

Comment by dimir [ 2011 Sep 21 ]

Looks like the same bug but the fix (ZBX-3889) actually only deals with deadlocks. So I guess ZBX-1401 is not actually fixed. The fix will be available here.

Comment by dimir [ 2011 Sep 22 ]

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

Comment by dimir [ 2011 Oct 04 ]

Fixed in trunk r22122, 1.8.9rc1 r22121.

Comment by dimir [ 2011 Oct 26 ]

I don't think so, as far as I understood that problem still exists.

Comment by Alexander Vladishev [ 2011 Oct 26 ]

Possible process hanging in function DBget_nextid() with already failed transaction:

1706:20111026:152111.516 In DBget_nextid() tablename:'triggers'
1706:20111026:152111.516 ignoring query [txnlev:1] [select nextid from ids where nodeid=0 and table_name='triggers' and field_
name='triggerid'] within failed transaction
1706:20111026:152111.516 ignoring query [txnlev:1] [select max(triggerid) from triggers where triggerid between 0 and 99999999
999] within failed transaction
1706:20111026:152111.516 ignoring query [txnlev:1] [insert into ids (nodeid,table_name,field_name,nextid) values (0,'triggers','triggerid',0)] within failed transaction
1706:20111026:152111.516 ignoring query [txnlev:1] [update ids set nextid=nextid+1 where nodeid=0 and table_name='triggers' and field_name='triggerid'] within failed transaction
1706:20111026:152111.516 ignoring query [txnlev:1] [select nextid from ids where nodeid=0 and table_name='triggers' and field_name='triggerid'] within failed transaction
1706:20111026:152111.516 ignoring query [txnlev:1] [select max(triggerid) from triggers where triggerid between 0 and 99999999999] within failed transaction
......................

Comment by dimir [ 2011 Nov 01 ]

Fixed in re-created development branch svn://svn.zabbix.com/branches/dev/ZBX-4158

  • avoid eternal loop within failed transaction when getting next id
  • do not cache event IDs
Comment by dimir [ 2011 Nov 04 ]

Fixed merge conflicts in development branch svn://svn.zabbix.com/branches/dev/ZBX-4158-trunk

Comment by dimir [ 2011 Nov 07 ]

Fixed in 1.8.9rc1 r22958, pre-1.9.8 r23003.

Generated at Fri Apr 26 17:00:46 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.