Jira (PDB-2642) PQL: Spike/research deactivated node handling

3 views
Skip to first unread message

Kenneth Barber (JIRA)

unread,
Apr 21, 2016, 11:55:09 AM4/21/16
to puppe...@googlegroups.com
Kenneth Barber created an issue
 
PuppetDB / New Feature PDB-2642
PQL: Spike/research deactivated node handling
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2016/04/21 8:47 AM
Priority: Normal Normal
Reporter: Kenneth Barber

The new index endpoint introduced the capability to query any entity without requiring a particular endpoint. This decision however meant that we had to make a decision about whether for all entity types, we were going to have to decide whether we show all entities even if they are on deactivated nodes, or not. In the past however, the `resource` endpoint (and others like facts) always hid data for deactivated nodes so this seems surprising to some users.

Not only that, hiding deactivated nodes doesn't even work that well in PQL without an implicit subquery across nodes. That is, the ["=", ["node","active"] true] magic doesn't have short-hand in PQL.

This ticket is about deciding what to do about that. In one sense, we've discussed removing this strange concept of deactivation, or amending it to something that works for us today. In another sense, query context might decide - and one thing has been discussed is that users wanting to query from puppet itself never want to see facts or resources from deactivated nodes.

I think this solution is still to be worked out, and this is what this ticket is about - creating a proposal and then deciding on an implementation to fix.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Ryan Senior (JIRA)

unread,
May 23, 2016, 4:39:04 PM5/23/16
to puppe...@googlegroups.com

Wyatt Alt (JIRA)

unread,
Mar 22, 2017, 8:09:02 PM3/22/17
to puppe...@googlegroups.com
Wyatt Alt commented on New Feature PDB-2642
 
Re: PQL: Spike/research deactivated node handling

We spoke about this with Nick Walker the other day. Current thinking is the most backward compatible way to do this could be to add an all_nodes PQL entity to include all nodes, and change the behavior of nodes {} to exclude deactivated/expired nodes by default. We have latitude for this until the next PDB is released, after which we will run into API versioning issues.

This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Wyatt Alt (JIRA)

unread,
Mar 22, 2017, 8:09:03 PM3/22/17
to puppe...@googlegroups.com
Wyatt Alt updated an issue
 
Change By: Wyatt Alt
Team: Foundational Features

Charlie Sharpsteen (JIRA)

unread,
Mar 22, 2017, 9:00:02 PM3/22/17
to puppe...@googlegroups.com
Charlie Sharpsteen commented on New Feature PDB-2642
 
Re: PQL: Spike/research deactivated node handling

I think it would make more sense to add an active_nodes entity. Otherwise folks who get used to nodes { } excluding results from deactivated entries will be surprised when another similarly-named entity like resources { } does include deactivated results. Or go back to implicitly filtering results from deactivated nodes in all entities, but provide command line switches and API headers that can turn this implicit filter off.

The problem with the old behavior was that it couldn't be disabled. This made certain queries like "list all nodes where last report is older than X days" an exercise in frustration as users had to run one query with active = true, another query with active = false and then perform a JOIN operation outside of the puppetdb tooling. Implicit WHERE clauses are bad if there is no way to turn them off when needed.

Daniel Parks (JIRA)

unread,
Apr 3, 2017, 12:07:03 AM4/3/17
to puppe...@googlegroups.com
Daniel Parks commented on New Feature PDB-2642

Please please please add a way to disable data from deactivated nodes.

I have never ever wanted to get data from a deactivated node, so I have to stick the nodes { deactivated is null and expired is null} somewhere in all my queries. It's really easy to forget, so I end up with results that don't make sense. It's an irritation every time I use PuppetDB.

I can't even fix it programmatically without a silly amount of effort (parse the PQL, add the deactivated subquery to each subquery, etc.).

An HTTP parameter would be wonderful.

Daniel Parks (JIRA)

unread,
Apr 3, 2017, 12:31:03 AM4/3/17
to puppe...@googlegroups.com
Daniel Parks commented on New Feature PDB-2642

To be clear, this suggestion from Charlie Sharpsteen would be really helpful:

Or go back to implicitly filtering results from deactivated nodes in all entities, but provide command line switches and API headers that can turn this implicit filter off.

Claudia Petty (Jira)

unread,
Jun 21, 2023, 10:59:40 AM6/21/23
to puppe...@googlegroups.com
Claudia Petty updated an issue
 
Change By: Claudia Petty
Labels: new-feature
This message was sent by Atlassian Jira (v8.20.21#820021-sha1:38274c8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages