[ZBX-9436] Zabbix can exit if transaction failed after successful connection to database Created: 2015 Mar 26  Updated: 2017 May 30  Resolved: 2015 Apr 09

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 2.4.4
Fix Version/s: 2.0.15rc1, 2.2.10rc1, 2.4.5rc1, 2.5.0

Type: Incident report Priority: Blocker
Reporter: Alexey Pustovalov Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: crash, database
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MySQL


Issue Links:
Duplicate

 Description   

When transaction fails, Zabbix tries to connect to database, after successful connection it executes "SET NAMES UTF8", but flag transaction error is not reset, so it exits.



 Comments   
Comment by dimir [ 2015 Mar 31 ]

If connection to the database is lost database engine rolls back (or at least should do it) all active transactions. In zabbix server in this case the transaction is marked as failed and all subsequent queries within that transaction are ignored. On the other hand when we are in the middle of a transaction we need to connect to the database, which also requires certain queries to perform. So we introduced a special flag that allows queries (for re-connection) in the middle of a transaction that is marked as failed.

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

Comment by Andris Zeila [ 2015 Apr 01 ]

(1) Instead of adding database connection flag (db_init) it would be simpler to store transcation flags at the start of zbx_db_connect(), reset them and restore at the end of zbx_db_connect() funciton. This way we won't have to do multiple checks for db_init inside execute, select, prepare, bind functions.

<dimir> RESOLVED in r52996

wiper CLOSED

Comment by Andris Zeila [ 2015 Apr 08 ]

Successfully tested

Comment by dimir [ 2015 Apr 08 ]

Fixed in pre-2.0.15 r53012, pre-2.2.10 r53014, pre-2.4.5 r53017, pre-2.5.0 r53018.

Generated at Fri Mar 29 12:34:49 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.