[PUP-5703] Handle cached catalog and pluginsync inconsistencies Created: 2016/01/11  Updated: 2016/03/17  Resolved: 2016/02/18

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

Type: New Feature Priority: Normal
Reporter: Josh Cooper Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PUP-5708 Deprecate pluginsync setting Closed
Template:
Epic Link: (Burnside) Direct Puppet: Client Static Catalog
Story Points: 3
Sprint: Client 2016-02-10, Client 2016-02-24
Release Notes: New Feature
Release Notes Summary: * By default, the value of {{pluginsync}} will be coerced to be compatible with value of {{use_cached_catalog}}.
* If {{pluginsync}} is explicitly set via command-line or {{puppet.conf}}, then that setting will be honored even when it may result in an inconsistent state between the catalog and the plugins that support it.

 Description   

Currently, use_cached_catalog and pluginsync can be set to "conflicting" values, causing the agent to use different versions of plugins than the catalog. For example, the catalog could contain a new resource parameter that the older pluginsync'ed lib/puppet/type/foo.rb doesn't know about. Ideally, pluginsync should only occur when requesting a new catalog, and skipped when applying a cached catalog. However, we cannot ignore pluginsync without a deprecation cycle.

For 4.4, if use_cached_catalog is true, then we will change the default value of pluginsync. However, if pluginsync is explicitly set on the command line or puppet.conf, then that should always win.

For this ticket:

If pluginsync is set explicitly, then do
If use_cached_catalog is false, then pluginsync should default to true.
If use_cached_catalog is true, then pluginsync should default to false, so that we use the same set of plugins that matched the catalog when it was compiled.
If use_cached_catalog is true, but it doesn't have a cached catalog, but due to usecacheonfailure requests a new catalog, then we should probably set pluginsync=true unless the user explicitly set pluginsync=false.

There is a separate ticket to deprecate pluginsync.



 Comments   
Comment by John Duarte [ 2016/02/18 ]

Using puppet-agent at SHA b08cfa0 containing puppet at SHA 717e9bd all expectations for pluginsync pass.

Expectations

  • Default value of pluginsync should be coerced to be compatible with value of use_cached_catalog
  • If pluginsync is explicitly set via command-line or puppet.conf, then that setting will be honored.

Default pluginsync

Given no cached catalog

rm /opt/puppetlabs/puppet/cache/client_data/catalog/*
puppet agent -t --use_cached_catalog

  • expect pluginsync
  • expect no cached catalog

Given a cached catalog

puppet agent -t  --use_cached_catalog

  • expect no pluginsync
  • expect cached catalog

puppet agent -t  --no-use_cached_catalog

  • expect pluginsync
  • expect cached catalog

Explicitly setting pluginsync

Given no cached catalog

rm /opt/puppetlabs/puppet/cache/client_data/catalog/*
puppet agent -t --pluginsync --use_cached_catalog  # 'conflicting' combo

  • expect pluginsync
  • expect no cached catalog

rm /opt/puppetlabs/puppet/cache/client_data/catalog/*
puppet agent -t --no-pluginsync --use_cached_catalog  # 'compatible' combo

  • expect no pluginsync
  • expect no cached catalog

Given a cached catalog

puppet agent -t --no-pluginsync --use_cached_catalog  # 'compatible' combo

  • expect no pluginsync
  • expect cached catalog

puppet agent -t --no-pluginsync --no-use_cached_catalog  # 'conflicting' combo

  • expect no pluginsync
  • expect no cached catalog

puppet agent -t --pluginsync --use_cached_catalog  # 'conflicting' combo

  • expect pluginsync
  • expect cached catalog

puppet agent -t --pluginsync --no-use_cached_catalog  # 'compatible' combo

  • expect pluginsync
  • expect no cached catalog

Session results from p-a 1.3.5.250.gb08cfa0

Default pluginsync

Given no cached catalog

root@f7pclwdhpsm5q56:~# rm /opt/puppetlabs/puppet/cache/client_data/catalog/*
root@f7pclwdhpsm5q56:~# puppet agent -t --use_cached_catalog
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for f7pclwdhpsm5q56.delivery.puppetlabs.net
Info: Applying configuration version '1455812876'
Notice: Applied catalog in 0.02 seconds

Given a cached catalog

root@f7pclwdhpsm5q56:~# puppet agent -t  --use_cached_catalog
Info: Using cached catalog from environment 'production'
Info: Applying configuration version '1455812876'
Notice: Applied catalog in 3.32 seconds
 
root@f7pclwdhpsm5q56:~# puppet agent -t  --no-use_cached_catalog
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for f7pclwdhpsm5q56.delivery.puppetlabs.net
Info: Applying configuration version '1455814345'
Notice: Applied catalog in 0.02 seconds

Explicitly setting pluginsync

Given no cached catalog

root@i5nfkr1gt7bj7jo:~# rm /opt/puppetlabs/puppet/cache/client_data/catalog/*
root@i5nfkr1gt7bj7jo:~# puppet agent -t --pluginsync --use_cached_catalog  # 'conflicting' combo
Warning: Setting 'pluginsync' is deprecated.
   (at /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/defaults.rb:1592:in `block in <module:Puppet>')
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for i5nfkr1gt7bj7jo.delivery.puppetlabs.net
Info: Applying configuration version '1455747068'
Notice: Applied catalog in 0.02 seconds
 
root@i5nfkr1gt7bj7jo:~# rm /opt/puppetlabs/puppet/cache/client_data/catalog/*
root@i5nfkr1gt7bj7jo:~# puppet agent -t --no-pluginsync --use_cached_catalog  # 'compatible' combo
Warning: Setting 'pluginsync' is deprecated.
   (at /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/defaults.rb:1592:in `block in <module:Puppet>')
Info: Using configured environment 'production'
Info: Caching catalog for i5nfkr1gt7bj7jo.delivery.puppetlabs.net
Info: Applying configuration version '1455747076'
Notice: Applied catalog in 0.02 seconds

Given a cached catalog

root@i5nfkr1gt7bj7jo:~# puppet agent -t --no-pluginsync --use_cached_catalog  # 'compatible' combo
Warning: Setting 'pluginsync' is deprecated.
   (at /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/defaults.rb:1592:in `block in <module:Puppet>')
Info: Using cached catalog from environment 'production'
Info: Applying configuration version '1455747076'
Notice: Applied catalog in 0.02 seconds
 
root@i5nfkr1gt7bj7jo:~# puppet agent -t --no-pluginsync --no-use_cached_catalog  # 'conflicting' combo
Warning: Setting 'pluginsync' is deprecated.
   (at /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/defaults.rb:1592:in `block in <module:Puppet>')
Info: Using configured environment 'production'
Info: Caching catalog for i5nfkr1gt7bj7jo.delivery.puppetlabs.net
Info: Applying configuration version '1455747111'
Notice: Applied catalog in 0.02 seconds
 
root@i5nfkr1gt7bj7jo:~# puppet agent -t --pluginsync --use_cached_catalog  # 'conflicting' combo
Warning: Setting 'pluginsync' is deprecated.
   (at /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/defaults.rb:1592:in `block in <module:Puppet>')
Info: Using cached catalog from environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Applying configuration version '1455747111'
Notice: Applied catalog in 0.02 seconds
 
root@i5nfkr1gt7bj7jo:~# puppet agent -t --pluginsync --no-use_cached_catalog  # 'compatible' combo
Warning: Setting 'pluginsync' is deprecated.
   (at /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/defaults.rb:1592:in `block in <module:Puppet>')
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for i5nfkr1gt7bj7jo.delivery.puppetlabs.net
Info: Applying configuration version '1455747122'
Notice: Applied catalog in 0.02 seconds

Generated at Sun Sep 27 15:04:06 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.