Issue #2964 has been reported by Dan Bode.

----------------------------------------
Bug #2964: updated resources cannot be collected until they are exported twice
http://projects.reductivelabs.com/issues/2964

Author: Dan Bode
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 0.25.1
Keywords: 
Branch: 


I noticed the following behavior. When an exported resource already exists in 
the database, and I want to update a param, puppet has to run twice to update 
the param.

1. The first run removes the param_values row
2. The second run updates teh param_values row.

Is this the expected bahavior?

Below is a detailed example:


#Here is the basic file
site.pp
<pre>
node exporter {
  @@host { 'test':
           ip => "127.0.0.1",
  }
}
node collector {
  Host<<| |>>
}
</pre>

#export for the first time
[r...@exporter manifests]# puppetd --certname exporter --test

and here is the db
<pre>
mysql> select * from param_values;
+----+-----------+---------------+------+-------------+---------------------+---------------------+
| id | value     | param_name_id | line | resource_id | updated_at          | 
created_at          |
+----+-----------+---------------+------+-------------+---------------------+---------------------+
| 45 | 127.0.0.1 |             1 | NULL |          52 | 2009-12-18 17:30:14 | 
2009-12-18 17:30:14 | 
+----+-----------+---------------+------+-------------+---------------------+---------------------+
1 row in set (0.00 sec)

mysql> select * from resources where title='test';
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
| id | title | restype | host_id | source_file_id | exported | line | 
updated_at          | created_at          |
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
| 52 | test  | Host    |      14 |              2 |        1 |    4 | 
2009-12-18 17:30:14 | 2009-12-18 17:30:14 | 
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+

</pre>

now change the ip address to 127.0.0.2
# this removed the param values from the db????
[r...@exporter manifests]# puppetd --certname exporter --test
<pre>
mysql> select * from param_values;
Empty set (0.00 sec)
mysql> select * from resources where title='test';
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
| id | title | restype | host_id | source_file_id | exported | line | 
updated_at          | created_at          |
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
| 52 | test  | Host    |      14 |              2 |        1 |    4 | 
2009-12-18 17:30:14 | 2009-12-18 17:30:14 | 
+----+-------+---------+---------+----------------+----------+------+---------------------+---------------------+
1 row in set (0.00 sec)
</pre>

of coarse, we cant properly collect now
[r...@collector manifests]# puppetd --certname collector --test
info: Caching catalog for collector
info: Applying configuration version '1261186363'
notice: Finished catalog run in 0.09 seconds

#now if I run it a second time, the ip is updated in the db
[r...@exporter manifests]# puppetd --certname exporter --test
<pre>
mysql> select * from param_values;
+----+-----------+---------------+------+-------------+---------------------+---------------------+
| id | value     | param_name_id | line | resource_id | updated_at          | 
created_at          |
+----+-----------+---------------+------+-------------+---------------------+---------------------+
| 46 | 127.0.0.2 |             1 |    4 |          52 | 2009-12-18 17:35:30 | 
2009-12-18 17:35:30 | 
+----+-----------+---------------+------+-------------+---------------------+---------------------+
1 row in set (0.00 sec)

</pre>


#now collection works
[r...@collector manifests]# puppetd --certname collector --test
info: Caching catalog for collector
info: Applying configuration version '1261186363'
notice: //Node[collector]/Host[test]/ip: ip changed '127.0.0.1' to '127.0.0.2'
info: Filebucket[/var/lib/puppet/clientbucket]: Adding 
/etc/hosts(2fff89c170a0f6eed1af1d711d189720)
notice: Finished catalog run in 0.10 seconds


is it supposed to work like this?


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--

You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.


Reply via email to