Brice Figureau wrote:

> That's a concurrency issue, IMHO.
> If you have several hosts checking in at the same time, they both starts
> a new isolated sql transaction, they both want to write the same fact
> names because the tables are empty. You end up with as many identical
> fact_names as there were concurrent host checking in their config.

> I thought about this issue a couple of weeks ago, but I couldn't find
> any solution to this issue, except running a fix up script that merges
> everything afterward (see ext/dbfix.sql in 0.24.8RC1).

While I don't know much about storeconfig, it sounds to me like you should
read up on the database concept of transactions.  With a little bit of care,
it will be impossible for one database client to do an insert inbetween
another client doing a select to find the table empty and inserting data.

Also (without knowing the database schema for storeconfig), if there is
only supposed to be one row for each value of param_name.name or fact_name.name
in the database, then you should probably set up a unique index for those
columns, so the database will prevent you from getting it wrong.

(And yes, I know that MySQL with MyISAM tables doesn't support transactions.
That's not a problem; even if you want to use MySQL, just tell it to use
Innodb.)


        /Bellman

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to