On 08/02/14 00:37, Peter Meier wrote:
> On 02/07/2014 08:26 PM, John Bollinger wrote:
> 
> 
>> On Friday, February 7, 2014 3:57:00 AM UTC-6, Brice Figureau
>> wrote:
> 
>> In this specific bug, I'm wondering if we really need to have
>> those defined type as resources in the RAL catalog (I believe it
>> might be used for relationship or event propagation).
> 
> 
> 
>> I suspect that defined type instances could be removed from the
>> catalog by replacing them with the collections of resources the
>> represent (recursively).  However, I would expect that to cause an
>> explosion in the number of relationships (both signaling and
>> non-signaling) that must appear in the catalog.
> 
> 
> "Flattening" the catalog is something that we have discussed before
> [1] and which would give imho quite some improvements.
> 
> However, we would likely loose important context information, that
> should then be preserved differently.
> 
> Coming back to the "Bug": I think swapping the statement would give
> already some improvement and is a fix that could go into the next
> (bugfix)-release. Given that there are no concerns regarding possible
> side effects.

Unfortunately there's a side-effect. The problem is when you start the
master, it creates a settings catalog with file resources in it. Those
will be then subject to the to_hash method, which calls parse_title
which calls in turn resource_type. With the swapped statements, this
will call known_resource_types. Since it's the first time, it will
initialize itself and will trigger a full parse of the manifests.
Beforehand, it would end-up in the Puppet::Type.type which would return
true and completely skip this initial parsing until a catalog gets compiled.

I have an interim patch that instead mark defined type resources as
defined types, I'll update the bug report with my findings.
The drawback of course is that it adds a property that gets serialized
in the catalog. If the property is not present (like an older master to
a newer agent), the agent resorts to the old behavior of testing first
for a builtin type then a definition.

I'll polish the patch, and make sure there are tests for it and will
push a PR as soon as I can for review.

Thanks!
-- 
Brice Figureau
My Blog: http://www.masterzen.fr/

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/52F646AE.302%40daysofwonder.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to