[ZBX-10761] clean wrong values in "triggers" table (for trigger prototypes) using db patches Created: 2016 May 06  Updated: 2017 May 30  Resolved: 2016 Aug 11

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.0.17, 2.2.11, 2.4.8, 3.0.2
Fix Version/s: 3.2.0alpha2

Type: Incident report Priority: Major
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: dbpatches, triggerprototypes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In ZBX-10759 I've described how columns "state" and "error" may get wrong values for trigger prototype, which may mislead zabbix users a lot.

I believe such wrong entries have to be fixed using upgrade patches.
It could be done in minor version upgrade, if not - then in next major version 3.2.

From a production installation:

mysql> select count(*) from triggers where flags=2;
+----------+
| count(*) |
+----------+
|     4512 |
+----------+
1 row in set (0.48 sec)

mysql> select error, count(*) from triggers where flags=2 and error not like "" group by error;
+----------------------------+----------+
| error                      | count(*) |
+----------------------------+----------+
| Agent is unavailable.      |     2481 |
| SNMP agent is unavailable. |       53 |
+----------------------------+----------+
2 rows in set (0.58 sec)

mysql> select state, count(*) from triggers where flags=2 group by state;
+-------+----------+
| state | count(*) |
+-------+----------+
|     0 |     1978 |
|     1 |     2534 |
+-------+----------+
2 rows in set (0.49 sec)


 Comments   
Comment by Oleksii Zagorskyi [ 2016 May 06 ]

One more point to discuss and decide:
If some host have trigger prototypes with such wrong values and if perform full host clone - such wrong values will be copied to new host, which is not very nice.
Note - for normal and lld-created triggers those values are not copied, the problem is only with trigger prototypes.

This sub issue could be closed as won't fix (when original bug will be fixed) but it have to be diced by frontend devs.

Comment by Sergejs Paskevics [ 2016 Aug 01 ]

Added upgrade patch in development branch svn://svn.zabbix.com/branches/dev/ZBX-10761

Comment by Alexander Vladishev [ 2016 Aug 01 ]

(1) Please do not use constants like TRIGGER_STATE_NORMAL and ZBX_FLAG_DISCOVERY_PROTOTYPE in the upgrade patches

s.paskevics RESOLVED in r61302, r61314

sasha CLOSED with fix in r61547, r61548.

Comment by Alexander Vladishev [ 2016 Aug 01 ]

(2) This patch is optional. Please remove mandatory flag .

s.paskevics RESOLVED in r61302, r61303, r61314

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Aug 01 ]

(3) Space between updated fields should be removed

No spaces are used around operators (comparison, mathematical, assignment etc) or commas that separate fields or values. This reduces amount of traffic to the SQL server.

s.paskevics RESOLVED in r61302, r61314

sasha CLOSED

Comment by Sergejs Paskevics [ 2016 Aug 11 ]

Fixed in 3.2.0alpha2 (trunk) r61582.

Generated at Sat Apr 20 01:48:27 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.