[softwaremgmt] Re: [zypp-devel] Source refresh policy
(Posting also to sw-management and yast, as this is (most of it) not zypp-specific. Please, discuss parts which are not zypp-specific on sw-management <opensuse-softwaremgmt@opensuse.org>.) Jiri Srain wrote:
Hi!
This is my suggestion on how to define the refresh policy with refactored ZYPP:
We need to keep the information when last a source was refreshed in order to decide whether a source needs to be refreshed or not. In addition, we will need some policies defining whether a source should be refreshed or not.
The basic refresh should be done by a cron job. However, there may be a reason not to do refresh via a cron job and do it only when SW management tool starts.
(if you don't have much time to read all this, skip to the IMPORTANT part below) I personally don't like either of these ideas: 1) If doing refresh in cronjob, the user can get surprisingly stuck when trying to use zypp in the very moment when the repos are being refreshed. Also the huge download happens without user's supervision. However, we can offer the user to set up the cron job for him, but we cannot do it behind his back. Or he can set up a cron job by himself. 2) Please NOT when a SW management tool starts!! This is much more annoying than getting a "repository out-of-date" warning! Let's leave it to the user when he wants to refresh. E.g., often user just wants to quickly check whether a package is in the repository and doesn't need an up-to-date data. At least, ask him at the tool start-up, and only if the refresh is needed (current repomanager is able to check whether a refresh is needed, Duncan do we have a simple method for the check, or is it hidden in the code? something like RepoManager::isUpToDate(RepoInfo) would be nice). What i said above does not hold true for every SW management tool. For example, updater applets should always have up-to-date data (as Jiri says a few lines below). IMPORTANT: always respect autorefresh setting! ...on the second thought... :O) We have this _autorefresh_ setting in .repo file which can be enabled/disabled for each repository separately by the user. If we respect this setting, then forget what i said above and i'll be fine with crons and on-start refreshing :O) behavior clarification: - autorefresh disabled - refresh metadata ONLY ON USER REQUEST (e.g. zypper refresh, (new) Refresh button in YaST). - autorefresh enabled - application chooses when to refresh We should just think about whether to enable or disable it by default. Example use case: for online update repo (small repo with patches) i'd use autorefresh enabled and let whatever app needs it to refresh it as it sees fit. But for factory i want to be in complete control when it will be refreshed (because of the amount of resources it takes - time, CPU, network), so i'd use autorefresh disabled. BTW: for cronjobs i'd recommend something like zypper refresh --respect-autorefresh (not implemented yet :O) because otherwise it would try to refresh all sources. (Also there will be zypper refresh --force to force refresh even if zypp indicates that it is not needed, but that's just by the way...)
There are two kinds of tools: 1. Tools which take care of having the system up-to-date. They must always work on as fresh metadata as possible 2. Tools which should install a package. They should work as fast as possible. we can pay the price of installing package which already has an update at least in some cases.
Therefore we need two different policies depending on the kind of source (this is optional) and on the operation user performs (they can be set to vehave the same of course).
How often refresh is being performed via cron (if it is) can be read from the cron configuration, I don't think we need to put this information to any configuration file.
In addition to cron, I suggest adding following variables (comments hopefully explain their meaning)
--- snip ---
# should the on-line update paplication (eg. YOU) consider doing a refresh # or should it rely on a cron job? ONLINE_UPDATE_AUTO_REFRESH="yes"
# if the time since last refresh is higher than specified amount of time, # the update tools refresh the source first # if it is an update source (provided we have the tags); 0 means to refresh # always when starting the on-line update tool # filtering on-line update sources is questionable (consistency) ONLINE_UPDATE_REFRESH_INTERVAL="1h"
# should the desktop applet perform any refresh or just rely on cron job? DESKTOP_APPLET_REFRESH="yes"
# define how often the desktop applet should perform refresh. DESKTOP_APPLET_REFRESH_INTERVAL="3h"
# master switch for enabling or disabling auto refresh for software # management tools (eg. 'yast -i', 'zypper') # if disabled, refresh must be performed manually or via cron INSTALLER_AUTO_REFRESH="yes"
# auto refresh interval for tools primarily installing packages, not doing # update; "0" means always when initializing source(s) INSTALLER_AUTO_REFRESH_INTERVAL="24h"
--- snap ---
The above variables can be added to /etc/sysconfig/sw_management.
The way time is specified can be discussed, I guess that the granularity of hours or at most minutes is perfectly sufficient, however, we may support any of fixed units or specifying the units with the value (as in examples above).
Cheers, Jano -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
Dne čtvrtek 21 červen 2007 10:26 Jan Kupec napsal(a):
(Posting also to sw-management and yast, as this is (most of it) not zypp-specific. Please, discuss parts which are not zypp-specific on sw-management <opensuse-softwaremgmt@opensuse.org>.)
Jiri Srain wrote:
Hi!
This is my suggestion on how to define the refresh policy with refactored ZYPP:
We need to keep the information when last a source was refreshed in order to decide whether a source needs to be refreshed or not. In addition, we will need some policies defining whether a source should be refreshed or not.
The basic refresh should be done by a cron job. However, there may be a reason not to do refresh via a cron job and do it only when SW management tool starts.
(if you don't have much time to read all this, skip to the IMPORTANT part below)
I personally don't like either of these ideas:
1) If doing refresh in cronjob, the user can get surprisingly stuck when trying to use zypp in the very moment when the repos are being refreshed. Also the huge download happens without user's supervision. However, we can offer the user to set up the cron job for him, but we cannot do it behind his back. Or he can set up a cron job by himself.
The cron job was not meant as a must. Of course it is user's choice whether to use it or not. If he has many repositories, user may find it comfortable to get al lmetadata refreshed over night and when installing software not having to wait until repos get refreshed. How is this solved in 10.2 when updater applet refreshes sources?
2) Please NOT when a SW management tool starts!! This is much more annoying than getting a "repository out-of-date" warning! Let's leave it to the user when he wants to refresh. E.g., often user just wants to quickly check whether a package is in the repository and doesn't need an up-to-date data. At least, ask him at the tool start-up, and only if the refresh is needed (current repomanager is able to check whether a refresh is needed, Duncan do we have a simple method for the check, or is it hidden in the code? something like RepoManager::isUpToDate(RepoInfo) would be nice).
That's the reason why I suggested two different policies depending on the kind of application. If your environment is not changing to oheavily or you keep old versions, you can rely on updates made by the updater applet or a cron job.
What i said above does not hold true for every SW management tool. For example, updater applets should always have up-to-date data (as Jiri says a few lines below).
IMPORTANT: always respect autorefresh setting!
...on the second thought... :O) We have this _autorefresh_ setting in .repo file which can be enabled/disabled for each repository separately by the user. If we respect this setting, then forget what i said above and i'll be fine with crons and on-start refreshing :O)
behavior clarification: - autorefresh disabled - refresh metadata ONLY ON USER REQUEST (e.g. zypper refresh, (new) Refresh button in YaST). - autorefresh enabled - application chooses when to refresh
Of course. If a source has autorefresh disabled or the source itself is disabled, it should never be automatically refreshed. Sorry for misisng this point.
We should just think about whether to enable or disable it by default.
Currently we do it depending on the kind of source (disable for CDs, enable for network sources). Jiri -- Regards, Jiri Srain YaST Team Leader --------------------------------------------------------------------- SUSE LINUX, s.r.o. e-mail: jsrain@suse.cz Lihovarska 1060/12 tel: +420 284 028 959 190 00 Praha 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz
participants (2)
-
Jan Kupec
-
Jiri Srain