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
{{ message }}
Repository navigation
On Carbon and develop branches Executing a pkg state on Windows causes a pkg repo refresh EVERY time. #36088
PlatformRelates to OS, containers, platform-based utilities like FS, system based appsWindowsbugbroken, incorrect, or confusing behaviorseverity-criticaltop severity, seen by most users, serious issues
"This was introduced by this PR: #35899 " this is not correct. Its been in existence for a long time and is on all platforms not just windows. Other non-windows platforms are smarter at doing a refresh
In fact #35899 added code to allow a minimum time between refresh and warn if a refresh happens with 1 minute, so you can see if the issue is happening. i.e. you will see 2016-09-07 11:58:30 [salt.loaded.int.module.win_pkg][WARNING ] pkg meta db less than a minute old and been asked to refresh it
The code is in state/pkg.py which does the refresh #35899, only change two lines associated with the name space, anything to do with refresh has not been changed.
i.e.
- from salt.modules.win_pkg import _get_local_repo_dir
- _get_local_repo_dir = _namespaced_function(_get_local_repo_dir, globals())
The refresh is slow on windows because their is no sync feature for the cache, so everyone seems to delete everything in the cache and copy it again. Which is what the previous and existing windows code does. What it needs to speed it up, is a sync function for the cache or for general files so it only copies new files and removes files which no longer exist.
def mod_init(low):
ret = True
if 'pkg.ex_mod_init' in __salt__:
ret = __salt__['pkg.ex_mod_init'](low)
if low['fun'] == 'installed' or low['fun'] == 'latest':
rtag = __gen_rtag()
if not os.path.exists(rtag):
with salt.utils.fopen(rtag, 'w+'):
pass
return ret
return False
The title should be
pkg state on all platforms causes a pkg repo refresh per individual run of installed or latest.
The look at why this code has existed since version 0.11 it hurts windows the most because its the lowest, but it would also hurt OS with slow connections to a repo
PlatformRelates to OS, containers, platform-based utilities like FS, system based appsWindowsbugbroken, incorrect, or confusing behaviorseverity-criticaltop severity, seen by most users, serious issues
Activity
damon-atkins commentedon Sep 7, 2016
"This was introduced by this PR: #35899 " this is not correct. Its been in existence for a long time and is on all platforms not just windows. Other non-windows platforms are smarter at doing a refresh
In fact #35899 added code to allow a minimum time between refresh and warn if a refresh happens with 1 minute, so you can see if the issue is happening. i.e. you will see
2016-09-07 11:58:30 [salt.loaded.int.module.win_pkg][WARNING ] pkg meta db less than a minute old and been asked to refresh itThe code is in state/pkg.py which does the refresh #35899, only change two lines associated with the name space, anything to do with refresh has not been changed.
i.e.
The refresh is slow on windows because their is no sync feature for the cache, so everyone seems to delete everything in the cache and copy it again. Which is what the previous and existing windows code does. What it needs to speed it up, is a sync function for the cache or for general files so it only copies new files and removes files which no longer exist.
The long time existing code. If you call "installed" or "latest" it ask the platform implementation to do a refresh. The below code dates back to version 0.11 https://github.com/saltstack/salt/blob/0.11/salt/states/pkg.py
morganwillcock commentedon Sep 7, 2016
How many sls files are we talking about here?
damon-atkins commentedon Sep 8, 2016
The title should be
pkg state on all platforms causes a pkg repo refresh per individual run of installed or latest.
The look at why this code has existed since version 0.11 it hurts windows the most because its the lowest, but it would also hurt OS with slow connections to a repo
damon-atkins commentedon Sep 8, 2016
@morganwillcock if you use the sls files from https://github.com/saltstack/salt-winrepo-ng thats about 200 odd files. which are re-fetch every time you do a pkg.refresh_db due to a lack of smart sync function.
UtahDave commentedon Sep 8, 2016
This issue is better described in #36133 so I'm going to close this issue.