Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-8705

Add SRV record support to Puppet::Rest::Client

    Details

    • Type: Task
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.0.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide
      • Puppet::Rest::Client respects SRV records when available.
      • The record list for a service is cached once it has been resolved.
      • The cached of records should be invalidated when the shortest TTL among cached records has expired.
      • The found server for each service is cached once it has been selected.
      • The cache entry for a selected server is invalidated if the server is unreachable, and a new server is selected from the cached record list for that service, falling back to configured value if none is available.
      Show
      Puppet::Rest::Client respects SRV records when available. The record list for a service is cached once it has been resolved. The cached of records should be invalidated when the shortest TTL among cached records has expired. The found server for each service is cached once it has been selected. The cache entry for a selected server is invalidated if the server is unreachable, and a new server is selected from the cached record list for that service, falling back to configured value if none is available.
    • Team:
      Server
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      Needs Assessment

      Description

      **Update**

      In order to improve performance over the indirector's re-resolving SRV records on each request, we should implement something similar to Puppet::Network::Resolver but that caches the results of the SRV lookup for each service. The cache of SRV records should be invalidated based on the shortest TTL among the cache entries. This resolver should be an object whose lifetime is tied to the HTTP client making requests with its results. (Note that currently the HTTP clients are created where needed and their configuration is locked, but eventually we will probably use one client for all requests, at which point the DNS cache will therefore also be global). The client should then in turn cache the selected server and port, and that cache entry should only be invalidated if the cached server becomes unreachable for any reason, including a 500 error. At this point the server and port should be reselected from the cached SRV record inside the Resolver.

      **Original text**

      Currently, Puppet::Rest::Client does not do any SRV lookups, unlike the other indirector-based HTTP client in Puppet. We need to implement this, once we fully understand the tradeoffs between performance and the need to restrict caching due to the nature of SRV lookups.

      A quick look at the current implementation (https://github.com/puppetlabs/puppet/blob/master/lib/puppet/indirector/request.rb#L187-L197 and https://github.com/puppetlabs/puppet/blob/master/lib/puppet/network/resolver.rb#L8-L41) makes it look as though DNS::Resolv objects and SRV lookups are performed on every request. We need to evaluate whether this is necessary, or more could be done to cut down on work that must be done per-request.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                maggie Maggie Dreyer
                Reporter:
                maggie Maggie Dreyer
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: