Jira (PUP-10499) Out-of-sync no-op resources should cause dependent resources to skip

8 views
Skip to first unread message

Reid Vandewiele (Jira)

unread,
May 11, 2020, 3:01:03 PM5/11/20
to puppe...@googlegroups.com
Reid Vandewiele created an issue
 
Puppet / Improvement PUP-10499
Out-of-sync no-op resources should cause dependent resources to skip
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2020/05/11 12:00 PM
Priority: Normal Normal
Reporter: Reid Vandewiele

Let resource A be a dependency of resource B
Let resource A be no-op

Problem

Puppet will always consider B's dependency to be satisfied, even if resource A is detected to be out-of-sync.

Resource A is in no-op mode so it cannot "fail". Puppet will never skip resource B due to a dependency failure. However, resource A is out-of-sync, and is known to be in an incorrect state. Logically, this should cause resource B to be skipped, just as it would be if resource A were to be marked out-of-sync due to a sync failure.

Depending on your dependency chains this behavior can cause problems, when Puppet cannot successfully configure resource B unless or until resource A is in-sync.

Example Manifest

file { 'dependency':
  path   => '/tmp/never-create-me',
  ensure => present,
  noop   => true,
}
 
notify { 'reliant':
  message => 'I rely on dependency being in-sync to operate correctly',
  require => File['dependency'],
} 

Behavior Today

Output of puppet apply:

Notice: Compiled catalog for reids-macbook-pro.local in environment production in 0.03 seconds
Notice: /Stage[main]/Main/File[dependency]/ensure: current_value 'absent', should be 'present' (noop)
Notice: I rely on dependency being in-sync to operate correctly
Notice: /Stage[main]/Main/Notify[reliant]/message: defined 'message' as 'I rely on dependency being in-sync to operate correctly'
Notice: Applied catalog in 0.02 seconds 

Notice how a dependency of Notify[reliant] is out-of-sync, but Puppet will still attempt to sync Notify[reliant]

Desired Behavior

What the output of puppet apply should be:

Notice: Compiled catalog for reids-macbook-pro.local in environment production in 0.03 seconds Notice: /Stage[main]/Main/File[dependency]/ensure: current_value 'absent', should be 'present' (noop)
Notice: /Stage[main]/Main/Notify[reliant]: Dependency File[dependency] in sync: false
Warning: /Stage[main]/Main/Notify[reliant]: Skipping because of out of sync dependencies 

Considerations

While it is desirable to expect that an out-of-sync dependency will cause resources that rely on it to be skipped, this behaviour would need to be feature flagged as it is a different behavior than what we have today.

This likely hasn't caused wider confusion mostly because no-op is frequently an all-or-nothing operation; it's less common to no-op some resources and not others, though doing so is highly sought after by many Puppet-as-a-Service customers and is made easier to do using patterns and modules like the popular trlinkin-noop.

Maybe something like... resource_dependency_requirement?

[main]
resource_dependency_requirement = none_failed
resource_dependency_requirement = in_sync

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Rob Braden (Jira)

unread,
May 18, 2020, 1:53:03 PM5/18/20
to puppe...@googlegroups.com

Rob Braden (Jira)

unread,
May 18, 2020, 1:53:03 PM5/18/20
to puppe...@googlegroups.com

Rob Braden (Jira)

unread,
May 18, 2020, 1:53:04 PM5/18/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Aug 18, 2020, 1:35:04 AM8/18/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages