[PUP-4748] Allow resources to be purged even when they have dependency relationships Created: 2015/06/11  Updated: 2016/03/17  Resolved: 2016/02/26

Status: Closed
Project: Puppet
Component/s: Breaking Change
Affects Version/s: None
Fix Version/s: PUP 4.4.0

Type: Bug Priority: Normal
Reporter: Kylo Ginsberg Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MODULES-3030 Firewall module not purging unmanaged... Accepted
relates to PUP-1963 Generated resources never receive dep... Closed
Template:
Story Points: 2
Sprint: Client 2016-02-24, Client 2016-03-09
Release Notes: Bug Fix
Release Notes Summary: It's now possible to purge a resource that has downstream dependents, such as notifying a service to restart. This reinstates behavior that was possible prior to PUP-1963.

 Description   

Please see PUP-1963 for the original problem report and some detailed breakdown of these two issues. The fix for PUP-1963 will be the first part (of two) of the fix for the problem report, and this ticket will be the second part.



 Comments   
Comment by Curtis Ruck [ 2016/01/12 ]

This would revert to original behavior the fact that PUP-1963 introduced a breaking change when dealing with stages and resource purging.

Comment by Curtis Ruck [ 2016/01/12 ]

Argh, this should of been included in the original PUP-1963 fix, and having this would have maintained existing (if not the puppet way) functionality that larger deployements have.

So before PUP-1963, resources purged even if they had dependencies (because they really didn't have any). So how is this a breaking change, when it brings back the original functionality, prior to PUP-1963.

Comment by John Duarte [ 2016/02/26 ]

Validated using puppet-agent at e4f14a5 containing puppet at 6a1b004 on Debian 8 amd64.

Validated using Curtis Ruck's example from PUP-1963.

Results of applying purge with dependencies.

~# cat /opt/puppetlabs/puppet/VERSION
1.3.5.319.ge4f14a5
~# puppet apply --modulepath . -v bug.pp
Notice: Compiled catalog for upwmn6959aegibe.delivery.puppetlabs.net in environment production in 0.11 seconds
Info: Applying configuration version '1456519091'
Notice: /Stage[main]/Main/Host[localhost]/ensure: removed
Info: Computing checksum on file /etc/hosts
Notice: /Stage[main]/Main/Host[localhost.vm]/ensure: removed
Notice: /Stage[main]/Main/Host[ip6-allnodes]/ensure: removed
Notice: /Stage[main]/Main/Host[ip6-allrouters]/ensure: removed
Notice: /Stage[main]/Main/Host[updates.puppetlabs.com]/ensure: removed
Notice: Applied catalog in 0.05 seconds

For comparison, here is the failure as demonstrated using puppet-agent version 1.3.5 showing that the dependent resources are not purged.

~# cat /opt/puppetlabs/puppet/VERSION
1.3.5
~# puppet apply --modulepath . -v bug.pp
Info: Loading facts
Notice: Compiled catalog for k4rm5xk1i2o80kr.delivery.puppetlabs.net in environment production in 0.10 seconds
Info: Applying configuration version '1456519205'
Warning: /Stage[main]/Main/Host[localhost]: Exec[reboot] still depends on me -- not purging
Warning: /Stage[main]/Main/Host[localhost.vm]: Exec[reboot] still depends on me -- not purging
Warning: /Stage[main]/Main/Host[ip6-allnodes]: Exec[reboot] still depends on me -- not purging
Warning: /Stage[main]/Main/Host[ip6-allrouters]: Exec[reboot] still depends on me -- not purging
Warning: /Stage[main]/Main/Host[updates.puppetlabs.com]: Exec[reboot] still depends on me -- not purging
Notice: Applied catalog in 0.64 seconds

Generated at Thu Feb 21 14:33:45 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.