Apt updates that are uniformly spread across all timezones, with predictable application windows
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Debian) |
Fix Released
|
Unknown
|
|||
apt (Ubuntu) |
Fix Released
|
High
|
Dimitri John Ledkov | ||
Xenial |
Fix Released
|
High
|
Dimitri John Ledkov | ||
Yakkety |
Won't Fix
|
High
|
Dimitri John Ledkov | ||
Zesty |
Fix Released
|
High
|
Dimitri John Ledkov | ||
Artful |
Fix Released
|
High
|
Dimitri John Ledkov | ||
unattended-upgrades (Debian) |
Fix Released
|
Unknown
|
|||
unattended-upgrades (Ubuntu) |
Fix Released
|
High
|
Dimitri John Ledkov | ||
Xenial |
Fix Released
|
High
|
Steve Langasek | ||
Yakkety |
Won't Fix
|
High
|
Dimitri John Ledkov | ||
Zesty |
Fix Released
|
High
|
Steve Langasek | ||
Artful |
Fix Released
|
High
|
Dimitri John Ledkov |
Bug Description
[ Impact ]
* unattended-upgrades are enabled by default in Ubuntu 16.04 and later
* Currently the following three things happen as a monolithic event:
- metadata updates: apt update
- download of updates: apt upgrade --download-only
- application of updates: apt upgrade
* For the long running instances, all of the above happens at random
times throughout the day.
* If systems were poweredoff / suspended, this happens on boot / resume
* End-users would like to have predictable timing, and control over when
the updates happen.
Considering all of the above, the following new behavior is proposed which should address all concerns in question. It combines all the desired properties from both end-user and mirror perspectives.
[ Proposed Default Behavior ]
* Decouple unattended-upgrades application, from apt update
* apt update:
- shall be a systemd timer based unit, triggered every 12h with a
random delay of 12h, therefore executed randomly twice a day.
- if unattened-upgrades (default on), or download-
are enabled, it should result in updates being downloaded aka
`apt upgrade --download-only`
* unattended-
- shall be a separate systemd timer based unit triggered at 6am local
time with a random delay of 1h, therefore executed between 6am and
7am local time.
* On boot / resume:
- if we have missed one, or more, apt update timers,
apt update / download upgrades / unattended-upgrade will happen in
sequence. This may result in mirror spikes, but we do want to secure
cold/
[Test Case]
* Run system for more than 24h, and check that apt updates were
automatically executed twice.
* Check that unattended upgrades were triggered to be applied at
6am..7am window, if any.
* Poweroff the machine over the period when apt-get update was
scheduled, poweron and observe that apt-get update / download /
unattended upgrade are all performed on boot.
* Downgrade systemd to the release version of the package (from
-security). Remove apt periodic stamp files rm /var/lib/
Then run 'sudo systemctl start apt-daily.service'.
Confirm that the systemd package is downloaded, but not upgraded.
[Regression Potential]
* The newly proposed behavior is a mix of Pre-xenial behavior of "do
everything at 6am..6:30am window" and the xenial+ behavior of "do
everything at random times throughout the day". If there are specific
deployments that rely on the previous types of behaviour they will be
able to adjust manually the systemd timers with the overrides to be
executed exactly as they wish; or match the .0 release behaviour that
they prefer.
* If timers behavior is coded wrongly the proposed behaviour might not be
executed as intended, thus requiring further SRUs to bring us in-line
with the great expectations.
[Other Info]
* Related bug reports and history:
- bug #1615482
- bug #1554848
Changed in apt (Ubuntu Xenial): | |
status: | New → Triaged |
Changed in apt (Ubuntu Yakkety): | |
status: | New → Triaged |
Changed in apt (Ubuntu Zesty): | |
status: | New → Triaged |
Changed in apt (Ubuntu Artful): | |
status: | New → Triaged |
Changed in apt (Ubuntu Xenial): | |
importance: | Undecided → High |
Changed in apt (Ubuntu Yakkety): | |
importance: | Undecided → High |
Changed in apt (Ubuntu Zesty): | |
importance: | Undecided → High |
Changed in apt (Ubuntu Artful): | |
importance: | Undecided → High |
description: | updated |
description: | updated |
Changed in unattended-upgrades (Ubuntu Xenial): | |
status: | New → Triaged |
Changed in unattended-upgrades (Ubuntu Yakkety): | |
status: | New → Triaged |
Changed in unattended-upgrades (Ubuntu Zesty): | |
status: | New → Triaged |
Changed in unattended-upgrades (Ubuntu Artful): | |
status: | New → Triaged |
Changed in unattended-upgrades (Ubuntu Xenial): | |
importance: | Undecided → High |
Changed in unattended-upgrades (Ubuntu Yakkety): | |
importance: | Undecided → High |
Changed in unattended-upgrades (Ubuntu Zesty): | |
importance: | Undecided → High |
Changed in unattended-upgrades (Ubuntu Artful): | |
importance: | Undecided → High |
tags: | added: patch |
Changed in apt (Debian): | |
status: | Unknown → New |
Changed in unattended-upgrades (Debian): | |
status: | Unknown → New |
Changed in apt (Debian): | |
status: | New → Fix Released |
Changed in unattended-upgrades (Ubuntu Artful): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in unattended-upgrades (Ubuntu Zesty): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in unattended-upgrades (Ubuntu Yakkety): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in unattended-upgrades (Ubuntu Xenial): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in apt (Ubuntu Artful): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in apt (Ubuntu Zesty): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in apt (Ubuntu Yakkety): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in apt (Ubuntu Xenial): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in unattended-upgrades (Debian): | |
status: | New → Fix Committed |
description: | updated |
Changed in unattended-upgrades (Ubuntu Xenial): | |
assignee: | Dimitri John Ledkov (xnox) → Steve Langasek (vorlon) |
status: | Triaged → In Progress |
Changed in unattended-upgrades (Ubuntu Zesty): | |
assignee: | Dimitri John Ledkov (xnox) → Steve Langasek (vorlon) |
status: | Triaged → In Progress |
description: | updated |
tags: |
added: verification-done verification-done-xenial removed: verification-needed verification-needed-xenial |
Changed in unattended-upgrades (Debian): | |
status: | Fix Committed → Fix Released |
tags: | removed: verification-done |
tags: |
added: verification-done-zesty removed: verification-needed-zesty |
tags: | added: id-597a831a26eaec02914e6202 |
tags: |
added: verification-done-xenial removed: verification-needed verification-needed-xenial |
I propose we simply split up the apt daily script and run that in two timers (one for fetching, the other for potentially destructive stuff like u-u and clean).
/usr/lib/ apt/apt. systemd. daily.common. sh
The shell functions used by both scripts (top part of script), plus the variables
(so right until the # update package lists part).
/usr/lib/ apt/apt. systemd. daily
The middle part of the current script, until u-u
/usr/lib/ apt/apt. systemd. destructive- daily
The final part of the script handling u-u, clean, and autoclean