Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalidate file list cache when cache file has a future last modified time #58529

Merged

Conversation

meaksh
Copy link
Contributor

@meaksh meaksh commented Sep 23, 2020

What does this PR do?

This PR fixes an issue in fileserver.check_file_list_cache which happens if the last modification time for the file list cache file is set to a future time.

When this situation happens, the cache file is always taken and never* refreshed. Therefore, new files placed on the "file_roots" are not visible for the minions.

Previous Behavior

We see these logs and cache file is NOT refreshed:

2020-09-22 13:36:48,228 [salt.fileserver  :143 ][DEBUG   ][11349] Cache file modified time is in the future, ignoring. file=/var/cache/salt/master
/file_lists/roots/base.p mtime=1600774608 current_time=1923304320
2020-09-22 13:36:48,229 [salt.fileserver  :159 ][DEBUG   ][11349] Returning file list from cache: age=0 cache_time=20 /var/cache/salt/master/file_
lists/roots/base.p

New Behavior

We see these logs and cache file is refreshed:

2020-09-22 13:37:42,475 [salt.fileserver  :143 ][DEBUG   ][12474] Cache file modified time is in the future, ignoring. file=/var/cache/salt/master
/file_lists/roots/base.p mtime=1600774662 current_time=1923304320
2020-09-22 13:37:42,475 [salt.fileserver  :153 ][WARNING ][12474] The file list_cache was created in the future!

Merge requirements satisfied?

Commits signed with GPG?

Yes

@meaksh meaksh requested a review from a team as a code owner September 23, 2020 14:10
@meaksh meaksh requested review from Akm0d and removed request for a team September 23, 2020 14:10
@ghost ghost requested a review from garethgreenaway September 23, 2020 14:10
Akm0d
Akm0d previously approved these changes Sep 23, 2020
@meaksh meaksh force-pushed the master-ignore-future-file-list-cache-file branch from e7cb7f2 to 4c4dd17 Compare January 7, 2021 15:52
@meaksh meaksh force-pushed the master-ignore-future-file-list-cache-file branch from 50d1c3d to b6b9492 Compare February 10, 2021 08:48
@meaksh
Copy link
Contributor Author

meaksh commented Feb 23, 2021

@Ch3LL @s0undt3ch this PR has been here for a while and it's ready to be merged.

Would you mind to take a look? Thanks!

@s0undt3ch s0undt3ch added this to the Aluminium milestone Feb 23, 2021
@s0undt3ch s0undt3ch added the Aluminium Release Post Mg and Pre Si label Feb 23, 2021
@s0undt3ch
Copy link
Collaborator

It's now properly tagged to go into the next major release.
It will get merged.

@Ch3LL Ch3LL merged commit 5c83c45 into saltstack:master Feb 24, 2021
@meaksh meaksh deleted the master-ignore-future-file-list-cache-file branch February 25, 2021 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aluminium Release Post Mg and Pre Si
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants