[PUP-6650] hiera_include doesn't work when using environment catalogs and environment caching Created: 2016/08/24  Updated: 2016/09/07  Resolved: 2016/09/02

Status: Closed
Project: Puppet
Component/s: Language
Affects Version/s: PUP 4.6.1
Fix Version/s: PUP 4.6.2

Type: Bug Priority: Blocker
Reporter: Nick Lewis Assignee: qa
Resolution: Fixed Votes: 0
Labels: regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PUP-6673 Acceptance: Add test for hiera_includ... Closed
Template:
Acceptance Criteria:

That the override of hiera_include in the environment compiler works also when an environment is cached, and when the environment has been in use for regular compilations before an environment compilation.

Story Points: 1
Sprint: Language 2016-09-07
Release Notes: Bug Fix
Release Notes Summary: Puppet 4.6.1 introduced a regression in the fix of PUP-6608 that affected the environment compiler used in application orchestration as it needs an override of the function {{hiera_include}} to ignore calls to that function. Due to functions now (in Puppet 4.6.1) being cached in the environment, the mechanism used to override the function would not always work, and when succeeding would disrupt regular compilations. This is now fixed.

 Description   

To address PUP-6527, the environment compiler pre-defines a non-functional version of hiera_include at the start of compilation. This causes the "real" version, which will fail if used during environment compilation, to never be loaded. However, now that loaders are cached between compilations, there are a couple of serious issues with this behavior:

• Environment catalog requests will fail if hiera_include is already present in the loader

For subsequent environment catalog requests, hiera_include has already either been loaded (if the previous request was for an agent catalog using hiera_include) in the loader or has been pre-loaded as a stub. Our attempt to explicitly define it causes a hard error, because it's a redefinition. This happens whether hiera_include is being used or not; multiple environment catalog requests will always fail if environment caching is enabled.

• hiera_include is non-functional during agent catalog requests following an environment catalog request

If the first request for a given process is for an environment catalog, a noop version of hiera_include is created. It will then persist through the lifetime of the environment cache, causing hiera_include in agent catalogs to do nothing. This happens with puppet job run, for instance.

The breaking change was introduced in 4.6.1 in commit 95ff24739ce85c3b7ca5ca1bffee9247c0cc2c5e.



 Comments   
Comment by Nick Lewis [ 2016/08/24 ]

ping Kylo Ginsberg Henrik Lindberg Thomas Hallgren

Comment by Henrik Lindberg [ 2016/08/24 ]

Hm, maybe we should support a loader instance that at an appropriate place in the hierarchy where the patched functions can be added. This loader would be cleared on each compilation.

Comment by Thomas Hallgren [ 2016/08/25 ]

I would highly recommend using ?w=1 when reviewing the PR-5232 diff

Comment by Henrik Lindberg [ 2016/08/25 ]

merged to stable at: 5464013

Comment by Kenn Hussey [ 2016/09/02 ]

John Duarte can this be resolved now that the release has shipped?

Comment by John Duarte [ 2016/09/02 ]

Shipped in puppet 4.6.2.
Additional acceptance testing ticketed under PUP-6673.

Generated at Mon Sep 28 15:25:21 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.