Issue #21659 has been updated by Adrien Thebo.

Status changed from In Topic Branch Pending Review to Merged - Pending Release
Target version set to 3.3.0

The behavior where the contents of a link were backed up upon removal were 
merged into master in 19a54fa; this should be released in 3.3.0.

----------------------------------------
Bug #21659: ensure => 'absent' on a symlink will filebucket the target of the 
symlink
https://projects.puppetlabs.com/issues/21659#change-94894

* Author: Jason Birch
* Status: Merged - Pending Release
* Priority: Normal
* Assignee: Adrien Thebo
* Category: filebucket
* Target version: 3.3.0
* Affected Puppet version: 3.1.1
* Keywords: filebucket symlink absent
* Branch: https://github.com/puppetlabs/puppet/pull/1762
----------------------------------------
If a file resource has the clause `ensure => 'absent'`, and the resource title 
(or path) refers to a symlink to a regular file, applying the puppet manifest 
will filebucket the destination file before removing the symlink. This 
behaviour is not observed on symlinks to special files, like /dev/random.

We then see some hilarious behaviour if there is a symlink to a large file. 
While we'd ideally like puppet to release there is a link to a file that there 
shouldn't be, not care anything about the target or content thereof, and simply 
remove the symlink itself, we get unneeded and unintended processing.

Puppet seems fully aware that it is removing a link, thought it still 
filebuckets the destination unnecessarily.

    $ dd if=/dev/urandom of=dest bs=64M count=32
    $ ln -s dest wellthisisembarrasing

    file { '/home/puppet/wellthisisembarrasing':
        ensure  => 'absent',
        purge   => true,
        force   => true,
    }

    Info: FileBucket adding {md5}c12d93b72ad1613a3b1ef4f0a5d1b3e4
    Info: /File[/home/puppet/wellthisisembarrasing]: Filebucketed 
/home/puppet/wellthisisembarrasing to puppet with sum 
c12d93b72ad1613a3b1ef4f0a5d1b3e4
    Debug: /File[/home/puppet/wellthisisembarrasing]: Removing existing link 
for replacement with absent
    Notice: /File[/home/puppet/wellthisisembarrasing]/ensure: removed

It also takes a long time to both md5 the file, and then to transfer the 
contents to the filebucket.

    $ time md5sum dest
    c12d93b72ad1613a3b1ef4f0a5d1b3e4  dest

    real        0m4.620s
    user        0m4.021s
    sys         0m0.460s

    $ time cp dest copy

    real        0m13.202s
    user        0m0.015s
    sys         0m2.188s

Versus the over 80 seconds spent in various filebucket operations.

    Changes:
                Total: 1
    Events:
              Success: 1
                Total: 1
    Resources:
              Changed: 1
          Out of sync: 1
              Skipped: 6
                Total: 8
    Time:
           Filebucket: 0.00
       Config retrieval: 0.14
             Last run: 1373376899
                 File: 86.95
                Total: 87.09
    Version:
               Config: 1373376811
               Puppet: 3.1.1


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to