Bug 1213985

Summary: [rfe] add equivalent of "random_sleep" to dnf-automatic
Product: [Fedora] Fedora Reporter: Gerd v. Egidy <gerd>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: 22CC: jsilhan, mluscon, packaging-team-maint, pnemade, rholy, tim.lauridsen, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-1.0.1-2.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-21 00:16:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gerd v. Egidy 2015-04-21 17:13:31 UTC
Currently I use yum-cron to let a bunch of servers automatically update themselves from a local mirror of the repositories. 

I have set the timing a bit more on the aggressive side: I want all servers to be up to date within one hour after updating the repository. But I do not want all servers to update at the same minute, because the repository mirror would be overloaded, and in case of VM guests, the VM host hosting the guests too.

So currently I schedule yum-cron every hour (01 * * * *) and have the option "random_sleep = 60" set in the yum-cron config. Also I have set "metadata_expire=10m" in my repository configuration to make sure no old data is used there.

The "random_sleep"-option distributes the start times of the updates randomly over the hour. This works well in practice and I used a similar technique with yum-updatesd before that was retired.

dnf-automatic.timer uses

OnBootSec=1h
OnUnitInactiveSec=1d

That makes the start time dependent on boot time. This is not the same as true randomness, because in case of a vm, all guests are autostarted when the host is up. Also after a power outage or scheduled power maintenance, all servers in the whole server room are started within a few minutes. So boot time is not distributed randomly enough.

So please add an equivalent of random_sleep to dnf-automatic.

Comment 1 Honza Silhan 2015-04-29 10:59:22 UTC
Thanks for the report. Valid use case.

Comment 2 Gerd v. Egidy 2015-06-07 20:42:48 UTC
Maybe it would make more sense to implement this at the systemd.timers level as other programs would also profit from this functionality then.

Relevant Systemd RFE: https://bugs.freedesktop.org/show_bug.cgi?id=82084

Comment 3 Fedora Update System 2015-06-12 09:05:38 UTC
dnf-1.0.1-2.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/dnf-1.0.1-2.fc22

Comment 4 Fedora Update System 2015-06-14 17:33:36 UTC
Package dnf-1.0.1-2.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-1.0.1-2.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-10004/dnf-1.0.1-2.fc22
then log in and leave karma (feedback).

Comment 5 Gerd v. Egidy 2015-06-15 19:57:58 UTC
Thank you for implementing this. I have tried dnf-1.0.1-2 and it works like expected.

Comment 6 Fedora Update System 2015-06-21 00:16:19 UTC
dnf-1.0.1-2.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.