The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #15026

Puppet has problems deleting large files

Added by Alex Jurkiewicz about 2 years ago. Updated almost 2 years ago.

Status:RejectedStart date:06/13/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:file
Target version:-
Affected Puppet version:2.7.1 Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

I have this snippet in our Puppet code:

    file { '/var/lib/mlocate/mlocate.db': ensure  => absent }

When mlocate.db is very large, Puppet uses a lot of memory deleting the file, and if the file is too large it crashes.

Test system:
    # free -mt               
    total       used       free     shared    buffers     cached
    Mem:          3961        739       3221          0          6         45
    -/+ buffers/cache:        687       3274
    Swap:         1906          0       1906
    Total:        5868        739       5128

Results (dd if=/dev/zero bs=1024K > mlocate.db)
100mb: works fine
3000mb: hits vsz 3150 rsz 3000mb, successfully deletes the file but all exec & service definitions fail with "Cannot allocate memory - fork(2)"
9000mb: unknown memory usage (didn't check), fails to delete the file with error "err: /Stage[main]/Soe/File[/var/lib/mlocate/mlocate.db]: Could not evaluate: Puppet::Util::Log requires a message". 

All other Puppet code works fine.

Then I added backup => false to the file definition and all the problems went away! It could delete 9gb file just fine.

History

#1 Updated by James Turnbull almost 2 years ago

  • Description updated (diff)

#2 Updated by James Turnbull almost 2 years ago

  • Status changed from Unreviewed to Rejected

The issue here is file-bucketing I suspect. Puppet is trying to backup the file before deleting it. I’m rejecting the ticket as the work-around specified is acceptable.

Also available in: Atom PDF