Thanks Zachary that doc is a great help. I'll lower the node-purge-ttl and see how it performs.
On Friday, 4 October 2019 22:14:04 UTC+1, Zachary Kent wrote: > > 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 > <https://puppet.com/docs/puppetdb/6.3/configure.html#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 > <https://puppet.com/docs/puppetdb/6.3/api/admin/v1/cmd.html#post-pdbadminv1cmd> > > 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 > <https://puppet.com/blog/preventative-maintenance-for-puppetdb-node-purge-ttl> > > 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 > <https://puppet.com/docs/puppetdb/6.3/configure.html#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! > > > On Thu, Oct 3, 2019 at 10:25 AM Andy Hall <andyjo...@gmail.com > <javascript:>> wrote: > >> 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 !! >> >> -- >> 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...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/puppet-users/9f3a3c96-29ec-401d-b3d4-cf6b8270535f%40googlegroups.com >> >> <https://groups.google.com/d/msgid/puppet-users/9f3a3c96-29ec-401d-b3d4-cf6b8270535f%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/6c54e96c-e09f-4e24-9bd1-b09d7c9d8919%40googlegroups.com.