Re: [Puppet Users] Re: Are facts cached?

Mohamed Lrhazi
Mon, 18 Apr 2011 21:12:41 -0000

That definitely explains the db part.. I still have no clue why the
puppet agent ganerated facts would be effected by the database on the
master though.

Thanks a lot.

On Mon, Apr 18, 2011 at 9:39 AM, Frank Sweetser <fs@wpi.edu>
wrote:
> On 4/18/2011 12:38 AM, Mohamed Lrhazi wrote:
>>
>> This was driving me nuts... I did an rm -rf /var/lib/puppet, on a
>> client machine, and after a rerun of puppet agent, the buggy facts
>> appear again.
>> when I run the agent against the test master, no buggy facts... and
>> then it hit me that I am using stored configs, and the facts are in
>> mysql db, but why would that effect the facts as generated on the
>> clients?
>> I dropped the puppet db and restarted the master, and viola! buggy
>> facts gone... almost, they still reappear as I must have one or two
>> nodes who are still generating them, but will fix soon.
>>
>> anyone understand what I am talking about? :) What exactly is
>> happening? what I call buggy fact ar the once with extra whitespace in
>> them:
>>
>> mysql>  select
concat(''['',name,'']'')  from fact_names where
name like
>> ''%gu_%'';
>> +------------------------+
>> | concat(''['',name,'']'')   |
>> +------------------------+
>
> (Is baner vs banner part of the issue here?)
>
>> | [gu_app_baner        ] |
>> | [gu_app_banner]        |
>
> It looks like you''re getting hit by the... let''s call it
a quirk that mysql
> doesn''t consider trailing whitespace in equality tests.  This
means that
> when the database is checked to see if fact name
''gu_app_baner'' exists, the
> entry for ''gu_app_baner      '' causes the query to return
true.  Here''s a
> demonstration:
>
> mysql> create table names (`name` varchar(255) NOT NULL);
> Query OK, 0 rows affected (0.07 sec)
>
> mysql> insert into names values ("foo    ");
> Query OK, 1 row affected (0.00 sec)
>
> mysql> select concat(''['',name,'']'')
from names where name = "foo";
> +----------------------+
> | concat(''['',name,'']'') |
> +----------------------+
> | [foo    ]            |
> +----------------------+
> 1 row in set (0.02 sec)
>
> Beyond that, I have no idea what other impacts the trailing space would
> cause within puppet.
>
> For what it''s worth, postgresql doesn''t display this
behavior.
>
> --
> Frank Sweetser fs at wpi.edu  |  For every problem, there is a solution
that
> WPI Senior Network Engineer   |  is simple, elegant, and wrong. - HL
Mencken
>    GPG fingerprint = 6174 1257 129E 0D21 D8D4  E8A3 8E39 29E3 E2E8 8CEC
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.