Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-5381

Sync is bouncing nodes silently

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PDB 6.20.0, PDB 7.9.0, 7.15.0
    • PuppetDB
    • None
    • HA
    • 2
    • HA 2022-01-05, HA 2022-01-19
    • Needs Assessment
    • Bug Fix
    • Fixes an issue with sync and with /pdb/query/v4/<entity>/<certname> style queries
    • Needs Assessment

    Description

      Sync is bouncing nodes, and creating unnecessary calls to the currently expensive `has-newer-record-for-certname?`. Because it has the record already, the check is true and it does not enqueue the command. This results in a count of 0 for the nodes entity even though it did all the work of transferring and vetting a command, but just didn't enqueue it.

      The discrepancy is between the handling of ttls between produce-streaming-body which gets called by the query endpoint and stream-query-result which gets called by the trapperkeeper endpoint.

      produce-streaming-body properly handles the context, and turns it into query-config as expected

      query-config (select-keys context [:node-purge-ttl :add-agent-report-filter])
      

      In steam-query-result the node-purge-ttl setting needed to properly set the inactive_nodes CTE for the query is in the context. But we strip it out before proceeding to turn the AST into SQL.

      (select-keys context [:log-queries :query-id])
      

      Attachments

        Issue Links

          Activity

            People

              austin.blatt Austin Blatt
              austin.blatt Austin Blatt
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support