[ZBX-12434] No one clear missed objects from problem Created: 2017 Jul 28  Updated: 2024 Apr 10  Resolved: 2017 Sep 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Server (S)
Affects Version/s: 3.2.7
Fix Version/s: 3.2.8rc1, 3.4.2rc1, 4.0.0alpha1, 4.0 (plan)

Type: Problem report Priority: Critical
Reporter: Alexey Pustovalov Assignee: Vladislavs Sokurenko
Resolution: Fixed Votes: 0
Labels: problem, trigger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Causes
causes ZBX-12975 Foreign key constraint fails in events Closed
Duplicate
is duplicated by ZBX-9933 Triggers stay in PROBLEM state for re... Closed
Team: Team A
Sprint: Sprint 13, Sprint 14, Sprint 15, Sprint 16
Story Points: 3

 Description   

Currently only housekeeper can remove old records from problem table. It removes already closed problems older than 24 hours. If object (trigger, item, lld rule) is removed with active problem, the record will be removed only with its own event.



 Comments   
Comment by Andrea Biscuola (Inactive) [ 2017 Jul 28 ]

The root cause of the problem is that the housekeeper only delete problems that are actually resolved.
Also in the database there is no relation between an object (item, trigger or lld rule) and a problem, but only between an event and a problem and this mean that a problem will remain in the database until the housekeeper policy for an event will be executed (causing an ON DELETE CASCADE constraint on the problem table to delete the related problem records).

There are two solutions to this:

1 - Modify the housekeeper for checking if an active problem is associated with an object in some way and if not, delete the record.

2 - Create a user defined function in the database, executed by an associated trigger for EVERY table involved (I don't know exactly which ones, that need to be analyzed) upon a DELETE statement of an object, for deleting the corresponding problem records from the database automatically, without need to put the logic in the zabbix server or in the front-end.

Events and problems with proper relations (associated with an existing item), should continue to be managed by the housekeeper.

Personally, I would opt for solution no. 2, as this problem is not really application level logic, but more data integrity logic. Also, performance wise, it will be much more efficient to let the database engine do what it's good for (keeping data consistent and throw out garbage)

Comment by Andris Zeila [ 2017 Aug 30 ]

Successfully tested

Comment by Andris Zeila [ 2017 Sep 05 ]

Successfully tested

Comment by Vladislavs Sokurenko [ 2017 Sep 05 ]

Fixed in:
pre-3.2.8.rc1 r72181
pre-3.4.2rc1 r72182
pre-4.0 (plan) r72183

Comment by richlv [ 2017 Nov 01 ]

there seems to be a lack of a description on which proposed solution was chosen, if any.
how is it supposed to work now ?

Comment by Vladislavs Sokurenko [ 2017 Nov 01 ]

Please see housekeeper changes in https://www.zabbix.com/documentation/3.4/manual/installation/upgrade_notes_342#housekeeper_changes

Comment by richlv [ 2017 Nov 01 ]

thank you. it is useful to have such information in issues, quoting here :

Housekeeper changes

In previous 3.4.x versions, problems for a deleted item/trigger could not get deleted by housekeeper if they were not in a resolved status. From now on, if housekeeping of events is enabled then deleting an item/trigger will also delete events and problems generated by that item/trigger. If housekeeping of events is disabled then only problems of a deleted item/trigger will get deleted.

An optional database patch to clean up problems for deleted items and triggers has also been added.

still, it is not completely clear. it says "deleting an item/trigger will also delete events and problems generated by that item/trigger".
will this happen immediately, as the sentence implies, or only upon the next housekeeper run ?

additionally, it talks about "problems generated by that item/trigger" - can problems be generated by items ? such a possibility is not mentioned in https://www.zabbix.com/documentation/3.4/manual/web_interface/frontend_sections/monitoring/problems - if that is true, it might be worth removing "item" occurrences in that section

Comment by Vladislavs Sokurenko [ 2017 Nov 01 ]

still, it is not completely clear. it says "deleting an item/trigger will also delete events and problems generated by that item/trigger".

only upon the next housekeeper run

additionally, it talks about "problems generated by that item/trigger" - can problems be generated by items ? such a possibility is not mentioned in

it's related to unsupported state
https://www.zabbix.com/documentation/3.4/manual/config/notifications/unsupported_item

Comment by Oleksii Zagorskyi [ 2019 Apr 25 ]

JustĀ a note:

Looks like it's also not good in the article to suggest to set "ALTER TABLE housekeeper ENGINE = BLACKHOLE;" as we lose current fix effect.

https://zabbix.org/wiki/Docs/howto/mysql_partitioning

Generated at Thu Apr 25 16:15:42 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.