You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Corerelates to code central or existential to SaltP1Priority 1Returnersbugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Remove all directories in /var/cache/salt/master/jobs
Start up the salt-master process
Lots of directories/uuids/jids return to the /var/cache/salt/master/jobs directory
Our use case here is that we have similar symptoms to #10443 and we don't see (or don't currently understand) what the job cache provides us. We've filled up our disk a couple of times and were looking for a more permanent solution than adding a cron task to remove older files in the cache.
Another thing i have noticed is that when the master jobs cache contains all of these files, restarting the sale master takes 1h or more before it starts becuase there is some sanity check at startup that goes through all files in the jobs cache and itterating over all those files takes forever.
@harlanbarnes, @Grokzen, thanks for reporting. It seems that some more tuning needs to be provided for the master job cache, and possibly other salt auditing mechanisms.
Hi all - After looking over this issue, I think what is happening here is a badly-documented option via the job_cache boolean. We can't "turn off" the functionality of creating jid directories in the /var/cache/salt/master/jobs/ directory because Salt uses those directories to check for jid collisions.
What setting job_cache: False does is simply throw away the returns, but keeps the jids. So setting this value to False will reduce the size of the jid dirs, but won't disable their existence completely.
One thing you can do to reduce the size of the job cache dir is to set the cache cleaner to clean more regularly. You can do this by setting the keep_jobs option to 1. (Note that the keep_jobs option cannot be 0, or the local_cache.clean_old_jobs function will not run.)
I think at the very least the docs for the job_cache option needs to be updated.
Oh, also after testing the keep_jobs setting, the cache cleaner does remove the jid files from the jid dirs, but it doesn't remove the original directory that was created in /var/cache/salt/master/jobs/.
For example (note that job_cache is set to the default of True in this case, and that jid dir 30 has been cleaned, but the newest job, 19, has not been cleaned yet):
root@rallytime:~# ls /var/cache/salt/master/jobs/
19 26 30 51 91 92 d5 d6
root@rallytime:~# ls /var/cache/salt/master/jobs/30/
root@rallytime:~# ls /var/cache/salt/master/jobs/19/
f1cca89613752b2fb9a65b1450bec7
That particular behavior is a bug and should be fixed.
@harlanbarnes I think the responses above, as well as my fix in #3328 should help alleviate the troubles you're having with the job_cache option. Please let me know if you have any questions or suggestions.
Corerelates to code central or existential to SaltP1Priority 1Returnersbugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
Grokzen commentedon Dec 1, 2015
I have seen the same problem kinda. I see alot of the following files that fills up the disk and takes up alot of inodes.
Another thing i have noticed is that when the master jobs cache contains all of these files, restarting the sale master takes 1h or more before it starts becuase there is some sanity check at startup that goes through all files in the jobs cache and itterating over all those files takes forever.
jfindlay commentedon Dec 1, 2015
@harlanbarnes, @Grokzen, thanks for reporting. It seems that some more tuning needs to be provided for the master job cache, and possibly other salt auditing mechanisms.
jakehilton commentedon Jan 5, 2016
I'm also seeing this with 2015.8.3. Seems to ignore the job cache settings and fills up inodes until the system is unusable.
rallytime commentedon May 17, 2016
Hi all - After looking over this issue, I think what is happening here is a badly-documented option via the
job_cacheboolean. We can't "turn off" the functionality of creating jid directories in the/var/cache/salt/master/jobs/directory because Salt uses those directories to check for jid collisions.What setting
job_cache: Falsedoes is simply throw away the returns, but keeps the jids. So setting this value to False will reduce the size of the jid dirs, but won't disable their existence completely.One thing you can do to reduce the size of the job cache dir is to set the cache cleaner to clean more regularly. You can do this by setting the keep_jobs option to
1. (Note that thekeep_jobsoption cannot be0, or thelocal_cache.clean_old_jobsfunction will not run.)I think at the very least the docs for the
job_cacheoption needs to be updated.rallytime commentedon May 17, 2016
Oh, also after testing the
keep_jobssetting, the cache cleaner does remove the jid files from the jid dirs, but it doesn't remove the original directory that was created in/var/cache/salt/master/jobs/.For example (note that job_cache is set to the default of
Truein this case, and that jid dir30has been cleaned, but the newest job,19, has not been cleaned yet):That particular behavior is a bug and should be fixed.
Update job_cache and keep_jobs docs to be more specific to their beha…
rallytime commentedon May 17, 2016
@harlanbarnes I think the responses above, as well as my fix in #3328 should help alleviate the troubles you're having with the
job_cacheoption. Please let me know if you have any questions or suggestions.harlanbarnes commentedon May 18, 2016
Hi @rallytime - Thanks so much for looking into my issue! Yes, I think this will do it. Again, I appreciate all the work the Salt team does! - hb
rallytime commentedon May 18, 2016
Excellent! Glad to hear it. :)
Update job_cache and keep_jobs docs to be more specific to their beha…
[develop] Merge forward from 2016.3 to develop (#33408)