Open OrangeDog opened 3 years ago
There's also a lot of obsolete entries in /var/cache/salt/master/gitfs/{hash,refs}
, and no obvious way to safely remove them.
It's a valid feature request.
We frequently have these directories eating up to 20GB disk space (which was already increase from 10GB), it seems to grow continuously if not cleaned up. Thanks for the tip about git gc
- this might be a bit less intrusive than stopping the Salt master, removing /var/cache/salt/master/*
, and starting it again.
We have observed in our environment that the git garbage collector does clear up some disk space, but the salt master keeps some file handles open indefinitely. This leads to a slow creep of zombie files that are nominally deleted, but are actually still allocated on the disk.
The only solution we found was regularly restarting the salt master.
Has anyone experienced something similar and/or an alternative solution?
Is your feature request related to a problem? Please describe. When using gitfs and git_pillar, the cached repos will grow as more changes are pulled, but storage is never optimised and unreachable commits are never removed,
Describe the solution you'd like Runner function(s) to run
git gc
on all cached repos, and ideally a built-in schedule to run it. It could be tied to existing pillar/filesystem refresh rather than a separate call.Describe alternatives you've considered Creating a periodic schedule to run
find /var/cache/salt/ -type d -name '.git' -exec git --git-dir '{}' gc \;
Additional context I just saved over a GB of disk space doing this manually for the first time.