Hi Steve, 

The query you posted looks like the inactive_nodes CTE that's used as a 
default filter which strips inactive or deactivated nodes from the 
response. As far as I know it should show up on any query and I don't think 
it's related to gc in this case. 

On Monday, August 20, 2018 at 5:03:28 AM UTC-7, Steve Traylen wrote:
>
>
>
> Hi,
>
> We recently upgraded to puppetdb 4.4.
>
> There is query that takes a while to run, 3 or 4 minutes though we are 
> unsure of why it is even running.
>
> The query below looks related to some kind of clean up or garbage 
> collection however this particular puppetdb node has two relevant 
> properties:
>
> * gc-interval is set to 0 and indeed there are no gc events in the logs.
> * This particular node only receives /pdb/query requests and no /pdb/cmd 
> requests. We have always and still do dedicate nodes to command and query 
> traffic by redirection at haproxy level.
>
> What is the action that triggers the query below. 
>
> WITH inactive_nodes AS (SELECT certname FROM certnames WHERE (deactivated 
> IS NOT NULL OR expired IS NOT NULL)) SELECT fs.certname AS certnam e, 
> fp.name AS name, f.value AS value FROM factsets fs INNER JOIN facts f ON 
> fs.id = f.factset_id INNER JOIN fact_paths fp ON f.fact_path_id = fp.id 
> INNER JOIN value_types vt ON vt.id = f .value_type_id LEFT JOIN 
> environments env ON fs.environment_id = env.id WHERE (fp.depth = 0 AND 
> (((((fs.certname) in ( (SELECT fs.certname AS certname FROM factsets fs 
> INNER JOIN facts f ON fs.id = f.factset_id INNER JOIN fact_paths fp ON 
> f.fact_path_id = fp.id INNER JOIN value_types vt ON f.value_type_id = 
> vt.id LEFT JOIN environments env ON fs.environment_id = env.id WHERE (
> vt.id <> 5 AND ((fp.path = $1) AND (f.value_string = $2)))) ) ) AND 
> ((fs.certname) in ( (SELECT fs.certname AS certname FROM factsets fs INNER 
> JOIN facts f ON fs.id = f.factset_ id INNER JOIN fact_paths fp ON 
> f.fact_path_id = fp.id INNER JOIN value_types vt ON f.value_type_id = 
> vt.id LEFT JOIN environments env ON fs.environment_id = env.id WHERE (
> vt.id <> 5 AND ((fp.path = $3) AND (f.value_string = $4)))) ) )) AND ((
> fp.name = $5) OR (fp.name = $6))) AND NOT ((fs.certname) in ( (SELECT 
> inactive_nodes.certname AS certname FROM inactive_nodes) ) )))
>
> Steve Traylen.
>

-- 
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/ac4beffa-27f0-41d8-9914-0ff34805da36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to