-
Problem report
-
Resolution: Fixed
-
Trivial
-
4.4.5
-
Sprint 61 (Feb 2020), Sprint 62 (Mar 2020)
-
1
To find out if the event must be suppressed timers must find the hosts related to each event. This is done in several steps:
- prepare event queries
- get events to be checked
- get functionids associated to each event
- get current event suppress data
- get maintenance data for each query
- find hosts associated with each query (functionids->itemids->hostids)
- update event maintenance status based on host maintenance
...
The 1.1 step can be quite slow on Oracle databases:
22924:20200127:082441.109 slow query: 26.800426 sec, "select functionid,triggerid from functions where (triggerid between 1306534 and 1306538 or triggerid between 1306566 and 1306570 or triggerid bet...
Possible solutions:
- each timer processes subset of events, selected by mod(eventid, <timer processes>). Use similar approach to select functionids:
select f.triggerid,f.functionid from problem p left join functions f on f.triggerid=p.objectid where p.source=0 and p.object=0 and mod(p.eventid, <timer forks>)
- remove step 1.1 and change 2.1 to locate trigger, parse out functionids, then process like before (functionids->itemids->hostids)
Need to compare performance before deciding on best fix.