[ZBX-20582] Typo in lld_trigger.c Created: 2022 Feb 16  Updated: 2024 Apr 10  Resolved: 2022 Feb 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.0.0
Fix Version/s: 6.0.1rc1, 6.2.0alpha1, 6.2 (plan)

Type: Incident report Priority: Trivial
Reporter: Dmitry Sergienko Assignee: Artjoms Rimdjonoks
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File active_queries.png     PNG File commit.png     PNG File fixed_query.png     PNG File original_query.png     PNG File top.png     Text File zabbix-lld-triggers.patch    
Issue Links:
Duplicate
duplicates ZBX-20544 Slow LLD of triggers Closed
Team: Team C
Sprint: Sprint 85 (Feb 2022)
Story Points: 0.1

 Description   

It looks like a typo in "src/libs/zbxdbcache/dbsync.c" file which causes to performance degradation in PgSQL queries.

It was caused by code optimisation in commit "0e36dceb9857d2fdbca8a116b0ef1afbf6c80986"

Line 2247 now contains:

" where t.triggerid in (select distinct t.triggerid"

but nested select should refer to tg.triggerid instead.

 

Please find attached:

  1. top output showing postgres processes stuck in SELECT
  2. active queries containing aforementioned select with possible typo which causes server performance degradation
  3. explain analyze outputs with typo (original query) and without it (fixed query). The difference is 232588 ms vs 38 ms.
  4. screenshot of the commit

 

Thanks!

 

 



 Comments   
Comment by Dmitry Sergienko [ 2022 Feb 16 ]

Apologies for the wrong file I've mentioned before. It should be "src/zabbix_server/lld/lld_trigger.c", inside function lld_triggers_validate()

Attaching a patch with fix. Now active queries in pgsql are almost empty and server load decreased to the normal values.zabbix-lld-triggers.patch

Thanks!

Comment by Artjoms Rimdjonoks [ 2022 Feb 17 ]

Thank you,
Merged as part of ZBX-20544

Comment by Artjoms Rimdjonoks [ 2022 Feb 17 ]

Available in versions:

Generated at Tue Apr 08 01:18:04 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.