puppetdb 6x not deactivating from catalogs table

8 views
Skip to first unread message

Andy Hall

unread,
Oct 3, 2019, 5:25:53 PM10/3/19
to Puppet Users
hey there we have just migrated hundreds of hosts from 3.x to 6.x and although lots of work we are almost home and dry but have an issue with puppetdb which I hope can be solved. we are running puppetdb-6.3.4 but when removing an old node as follows:

puppet node deactivate <nodename>

the information is _not_ getting removed from puppetdb and we have to run the following sql manually:

delete from catalogs where certname in (select certname from certnames where deactivated is not null);

this is far from ideal and we really need this functionality to work again as we have numerous exported resources such as nagios which have to be removed when decommissioning a host.

please advise if this is a known issue or if we are doing something wrong.

thanks very much and keep up the good work !!

Zachary Kent

unread,
Oct 4, 2019, 9:14:04 PM10/4/19
to puppet...@googlegroups.com
Hi Andy,

Are you seeing the deactivated nodes' catalogs turn up in query results from PDB or only when you query the postgres table directly?

I'm wondering if you might be hitting some strangeness around the node-purge-ttl setting. This setting specifies the amount of time that the PDB garbage collection process will wait before permanently deleting a node even if it has been deactivated or expired. This setting is needed on the enterprise side of things but could be preventing the nodes that you have deactivated from being deleted right away.

I tried setting this value to node-purge-ttl=1s locally and was able to confirm that deactivating a node and then sending a purge_nodes command to the admin endpoint triggered gc and deleted the node.

Note that if you do try this approach you may want to consider using a batch_limit for the purge_nodes admin command. Otherwise the PDB will try to delete everything at once which may take a while. See this blog post that discusses some of the related issues.

Changing this setting will also speed up the purging of data from nodes that have fallen inactive for longer than node-ttl which is another thing to consider if you care about querying for nodes that have stopped checking in longer than node-ttl.

Hope this helps!


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9f3a3c96-29ec-401d-b3d4-cf6b8270535f%40googlegroups.com.

Andy Hall

unread,
Oct 9, 2019, 8:54:44 AM10/9/19
to Puppet Users
Thanks Zachary that doc is a great help. I'll lower the node-purge-ttl and see how it performs.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages