[ZBX-7674] Possibility of permanent locking history syncer processes because of IT Services Created: 2014 Jan 19  Updated: 2017 May 30  Resolved: 2014 Jan 30

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.0.11rc1, 2.2.2rc1
Fix Version/s: 2.0.12rc1, 2.2.3rc1, 2.3.0

Type: Incident report Priority: Critical
Reporter: Alexey Pustovalov Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: dbsyncer, ids, itservices, lock
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBX-7911 Auto registration as well as network ... Closed

 Description   

Services are updated by triggerid in process_events function. DBupdate_services function is called for each trigger, in the function ids table for service_alarms record can be locked (because of adding new service_alarams). Then another history syncer tries to lock service_alarms and wait when previous history syncer will free the record. But it can not do it because we define mutex in DBupdate_services function. So first process locked ids table record and wait when mutex will be free, the next one history syncer tries to update ids table with locked mutex and can not do it because of previous locked ids table.



 Comments   
Comment by Andris Zeila [ 2014 Jan 30 ]

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

Comment by Andris Zeila [ 2014 Jan 30 ]

(1) [F] When deleting a trigger all linked IT services are removed. Instead of removing service itself the trigger should be unlinked and SLA calculation disabled for this service.

Eduards RESOLVED r.42178,42196

oleg.egorov TESTED!

wiper CLOSED

Comment by Andris Zeila [ 2014 Jan 30 ]

(2) the changes described in (1) should be properly documented.

2.0

2.2

Please review.

martins-v Reviewed, with some minor alterations to the sentences. Could be closed.

wiper Thanks, CLOSED

Comment by Alexander Vladishev [ 2014 Feb 18 ]

(3) [S] src/zabbix_server/trapper/nodehistory.c: process_event() was called without DBflush_itservice_updates()

wiper RESOLVED in r42851

sasha CLOSED

Comment by Alexander Vladishev [ 2014 Feb 19 ]

(4) [S] incorrect name of function load_services_by_triggerd()

  • the function can be rewritten to support bulk load by trigger ids.

sasha RESOLVED in r42823, r42846.

wiper CLOSED

Comment by Alexander Vladishev [ 2014 Feb 19 ]

(5) [S] flush_service_updates() this code should be removed:

if (NULL == service_updates->values)
        return SUCCEED;

sasha RESOLVED in r42823, r42846.

wiper CLOSED

Comment by Alexander Vladishev [ 2014 Feb 19 ]

(6) [S] load_service_parents() should be rewritten to support bulk load of parent services

sasha CLOSED

Comment by Alexander Vladishev [ 2014 Feb 21 ]

(7) [S] 2.2 and trunk: this code can be rewritten to use zbx_vector_ptr_clean() function

for (i = 0; i < itservice_updates.values_num; i++)                                                              
        zbx_free(itservice_updates.values[i]);                                                                  
                                                                                                                        
itservice_updates.values_num = 0;                

wiper RESOLVED in 42892

sasha CLOSED

Comment by Alexander Vladishev [ 2014 Feb 21 ]

(8) [S] 2.2 and trunk: DBflush_itservice_updates() can be called from function process_events() only

wiper RESOLVED in r42892

sasha CLOSED

Comment by Andris Zeila [ 2014 Feb 21 ]

Merged 2.0 branch, released in pre-2.0.12rc1 r42877

Recreated development branch svn://svn.zabbix.com/branches/dev/ZBX-7674 based on 2.2 for merging and 2.2 specific updates.

Comment by Andris Zeila [ 2014 Feb 21 ]

(9) [F] Frontend changes must be merged from 2.0 into development branch svn://svn.zabbix.com/branches/dev/ZBX-7674, which already contains the required server changes.

Eduards RESOLVED r.42911

wiper thanks, CLOSED

Comment by Eduards Samersovs (Inactive) [ 2014 Feb 24 ]

Fixed in versions 2.2.3rc1 r.42913

Comment by Alexander Vladishev [ 2014 Feb 24 ]

(10) [S @2.0] wrong SQL statements when no services updated

 13586:20140224:122009.455 In DBflush_itservice_updates()
 13586:20140224:122009.455 In its_flush_updates()
 13586:20140224:122009.455 In its_load_services_by_triggerids()
 13586:20140224:122009.456 query [txnlev:1] [select serviceid,triggerid,status,algorithm from services where triggerid=13517]
 13586:20140224:122009.456 End of its_load_services_by_triggerids()
 13586:20140224:122009.457 In DBget_nextid() tablename:'service_alarms'
 13586:20140224:122009.457 query [txnlev:1] [select nextid from ids where nodeid=0 and table_name='service_alarms' and field_name='servicealarmid']
 13586:20140224:122009.457 query [txnlev:1] [select max(servicealarmid) from service_alarms where servicealarmid between 0 and 99999999999999]
 13586:20140224:122009.458 query [txnlev:1] [insert into ids (nodeid,table_name,field_name,nextid) values (0,'service_alarms','servicealarmid',0)]
 13586:20140224:122009.459 query [txnlev:1] [select nextid from ids where nodeid=0 and table_name='service_alarms' and field_name='servicealarmid']
 13586:20140224:122009.459 query [txnlev:1] [update ids set nextid=nextid+0 where nodeid=0 and table_name='service_alarms' and field_name='servicealarmid']
 13586:20140224:122009.460 query [txnlev:1] [select nextid from ids where nodeid=0 and table_name='service_alarms' and field_name='servicealarmid']
 13586:20140224:122009.460 End of DBget_nextid():1 table:'service_alarms' recid:'servicealarmid'
 13586:20140224:122009.460 End of its_flush_updates():SUCCEED
 13586:20140224:122009.460 End of DBflush_itservice_updates()

wiper RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-7674_2.0

sasha CLOSED Successfully tested!

Comment by Andris Zeila [ 2014 Feb 24 ]

2.0 fix released in pre-2.0.12rc1 r42944

Comment by Alexander Vladishev [ 2014 Feb 24 ]

svn://svn.zabbix.com/branches/dev/ZBX-7674 (@2.2) was successfully tested!

Please review my changes in r42948 before a merge.

wiper CLOSED

Comment by Andris Zeila [ 2014 Feb 25 ]

Relased in:
pre-2.0.12rc1 r42944
pre-2.2.3rc1 r42952
pre-2.3.0 r42953

Comment by Pavels Jelisejevs (Inactive) [ 2014 Feb 25 ]

(11) [F] Now when deleting a trigger, the status of the IT service is not updated.

Eduards RESOLVED r.42968

sasha REOPENED

Update statement should be created by using DB::update() method

Eduards RESOLVED r.43003

sasha CLOSED

Comment by Pavels Jelisejevs (Inactive) [ 2014 Feb 25 ]

(12) The API changelog has not been updated.

Eduards RESOLVED in https://www.zabbix.com/documentation/2.2/manual/api/changes_2.0_-_2.2?&#trigger

jelisejev Why is it noted in the 2.0-2.2 changelog? The issue has been fixed for 2.0.12 and 2.0.3, so it must be noted in these changelogs, the same as with with our main changelog.

Eduards Changelog updated:
https://www.zabbix.com/documentation/2.0/manual/appendix/api/changes_2.0
https://www.zabbix.com/documentation/2.2/manual/api/changes_2.2

jelisejev CLOSED.

Comment by Alexander Vladishev [ 2014 Feb 25 ]

(13) [S] When deleting a trigger, the new alerts are created without a timestamp. (clock = 0)

wiper RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-7674 r42960

sasha CLOSED Please review my changes in r42997.

wiper reviewed, CLOSED

Comment by Andris Zeila [ 2014 Feb 27 ]

Released in:
pre-2.0.12rc1 r43034
pre-2.2.3rc1 r43035
pre-2.3.0 r43036

Comment by Andris Zeila [ 2014 Feb 27 ]

Please review the documentation updates in (2)

martins-v Done!

Generated at Sat Apr 20 12:36:40 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.