[ZBX-10138] Host prototypes and discovered hosts are not removed with parent host Created: 2015 Dec 07  Updated: 2017 Jul 31  Resolved: 2015 Dec 21

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.2.11
Fix Version/s: 2.2.12rc1, 2.4.8rc1, 3.0.0alpha5

Type: Incident report Priority: Major
Reporter: Andris Zeila Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: delete, hostprototypes, lld
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When removing a "parent" hosts (for example by discovery actions) server does not remove its corresponding host prototypes and hosts created from them.

For example we have host host.A and a discovery rule with host prototype host.PROTO.
Two hosts host.A.1 and host.A.2 are discovered by this rule.
In this case removing host.A must also remove host prototype host.PROTO and hosts host.A.1,host.A.2.



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2015 Dec 10 ]

Fix for version 2.2 is available in development branch svn://svn.zabbix.com/branches/dev/ZBX-10138-22 revision 57138.

There are several places where in the future we might consider adding DBlock_hostids(). For example in DBdelete_hosts_with_prototypes() while we are busy deleting host prototypes another action may link a template with more host prototypes. Similarly in DBdelete_host_prototypes() while we are deleting discovered hosts LLD may occur and add more discovered hosts. Currently in lld_hosts_save() we don't check whether parent host prototype id is locked for deletion like we do in lld_graphs_save(), lld_items_save() and lld_triggers_save().

glebs.ivanovskis Registered as ZBX-12442.

Comment by Andris Zeila [ 2015 Dec 15 ]

(1) Please review my changes in r57211

glebs.ivanovskis Thank you! Accepted. CLOSED

Comment by Andris Zeila [ 2015 Dec 15 ]

Successfully tested

Comment by Glebs Ivanovskis (Inactive) [ 2015 Dec 21 ]

Fixed in pre-2.2.12rc1 r57304, pre-2.4.8rc1 r57305, pre-3.0.0alpha5 (trunk) r57306.

Comment by richlv [ 2016 Aug 11 ]

for the record, discovered in and a continuation of ZBX-9950

Generated at Wed Apr 24 13:13:20 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.