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

'statefile' is never pruned of files no longer in management

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:

      Description

      The 'statefile' (state.yaml) never cleans up entries which USED to be under management but are no longer in the catalog. This causes the statefile to grow without cleanup, and there could be a bunch of extra work puppet does on intialization that could be totally unneeded.

      I made a short gist that exercises the problem:

      https://gist.github.com/ahpook/52d80c597da59aebfada

      An interesting question that arose through this exploration: What is the purpose of the statefile? The setting help text is kind of untrue:

          # Where puppet agent and puppet master store state associated
          # with the running configuration.  In the case of puppet master,
          # this file reflects the state discovered through interacting
          # with clients.
          # The default value is '$statedir/state.yaml'.
          statefile = /opt/puppetlabs/puppet/cache/state/state.yaml
      

      The master code does not refer to the statefile at all, however. And the only state that appears to be stored are checked and synced timestamps, which appear to be related to to scheduling and auditing (see resource_harness.rb:39) but the details are not clear to me.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                eric.sorenson Eric Sorenson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support