Bug #2844

Recursion with purge doesn't purge some files

Added by Thomas Bellman 8 months ago. Updated 8 months ago.

Status:Closed Start:11/19/2009
Priority:High Due date:
Assigned to:Markus Roberts % Done:

0%

Category:file
Target version:0.25.2
Affected version:0.25.1 Branch:http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2844
Keywords:file recursion
Votes: 0

Description

Run the following manifest:

    node default
    {
    file {
        "/tmp/testdir":
        ensure => directory,
        recurse => true, purge => true;
        "/tmp/testdir/foo":
        content => "FOO!\n";
    }
    }

Works as it should. Now, manually create two extra files:

    # touch /tmp/testdir/foo2 /tmp/testdir/bar

and run the above manifest again. It only removes the “bar” file. This seems true for any “stray” file which starts with the same prefix as a file that is managed by the manifests.

This works in 0.24.8, but is broken in 0.25.1. I’ll try to bisect it closer tomorrow, but I don’t have more time tonight.

This could be pretty bad. I was building up my iptables rules from file fragments, and when I removed one rule from my Puppet manifests, the corresponding file wasn’t removed, and was thus left in the total. Luckily I noticed it on a test system…


Related issues

related to Puppet - Bug #2786: Unable to purge a directory in recurse mode if puppet sho... Closed 11/04/2009

History

Updated by James Turnbull 8 months ago

  • Status changed from Unreviewed to Investigating
  • Assigned to set to Markus Roberts

Updated by Markus Roberts 8 months ago

Reproduced and bisected. It came in with:

commit b3b76dffdd9cd8ed5c3d0230624bf05015bec5b8 Author: Luke Kanies luke@madstop.com Date: Thu Jul 23 16:51:22 2009 -0700

Fixing #2296 - overlapping recursions work again

This fixes the behaviour when you have file recursions
that overlap - we again correctly use the most
specific information.

It's still a bit expensive when you do this, but
at least it behaves correctly, and it should be
a rare circumstance.

Signed-off-by: Luke Kanies <luke@madstop.com>

Updated by Markus Roberts 8 months ago

  • Status changed from Investigating to Accepted

Updated by Markus Roberts 8 months ago

  • Status changed from Accepted to Ready for Testing
  • Keywords set to file recursion
  • Branch set to http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2844

Branch up at http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2844

I’ve tested it.

Updated by Markus Roberts 8 months ago

Worked for Thomas too.

Updated by James Turnbull 8 months ago

  • Status changed from Ready for Testing to Ready for Checkin

Updated by James Turnbull 8 months ago

  • Status changed from Ready for Checkin to Closed

Pushed in commit:“53b3b86681e3c56f8455e5d8458b4ea900a50406” in branch 0.25.x

Also available in: Atom PDF