Salt 2016.3.1 - Master Side Pillar Cache (backend: Disk) never Expires. #34279
Labels
Bug
broken, incorrect, or confusing behavior
Core
relates to code central or existential to Salt
P4
Priority 4
Pillar
severity-medium
3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description of Issue/Question
The master side pillar cache never expires. Once the master config for pillar_cache are added; the pillar values never get refreshed, until the file in /var/cache/salt/master/pillar_cache/ is manually deleted.
The master side pillar cache was introduced in this PR : #30686
Setup
Steps to Reproduce Issue
Step 1 : Start salt-master and salt-minion and accept minion key on master. Ensure test.ping works.
Step 2 : Fetch Pillar Values:
Observe the value.
Step 3 Change the pillar value:
Per the master configuration; the pillar_cache will expire after 10 seconds;
Step 4 Wait for 10 seconds; 1 mins; 1 hr (doesn't matter)
Workaround
Manually deleting the pillar cache forces the pillar to be rendered again:
Root Cause and Initial Investigation
The key that stores ttl by pillar keys is stored in memory and gets re-initialized to an empty list every time the pillar is requested: https://github.com/saltstack/salt/blob/develop/salt/utils/cache.py#L52
Therefore; the pillar always gets the data from the cache.
Versions Report
(Provided by running
salt --versions-report
. Please also mention any differences in master/minion versions.)The text was updated successfully, but these errors were encountered: