[Bug 1821101] Re: unattended-upgrades: Fall back to adjusting more packages' candidates when a package from an allowed origin can't be marked to install/upgrade
Balint Reczey
balint.reczey at canonical.com
Mon May 6 16:29:58 UTC 2019
Verified 1.1ubuntu1.18.04.7~16.04.3 on Xenial:
https://launchpadlibrarian.net/421614532/buildlog_ubuntu-xenial-amd64
.unattended-upgrades_1.1ubuntu1.18.04.7~16.04.3_BUILDING.txt.gz
Running ./test_rewind.py with python3
DEBUG:root:APT::VersionedKernelPackages is not set
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:falling back to adjusting test2-package's dependencies recursively
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:falling back to adjusting test3-package's dependencies recursively
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-old-package-dependency=2.0
DEBUG:root:pkg forbidden-dependency not in allowed origin
DEBUG:root:sanity check failed for: {'z-package=1.0', 'test3-old-package-dependency=2.0', 'test3-package=2.0', 'forbidden-dependency=2.0'}
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:falling back to adjusting test-package's dependencies recursively
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-old-package-dependency=2.0
DEBUG:root:falling back to adjusting test2-package's dependencies recursively
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-old-package-dependency=2.0
DEBUG:root:falling back to adjusting test3-package's dependencies recursively
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-old-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:falling back to adjusting test-package's dependencies recursively
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-old-package-dependency=2.0
DEBUG:root:falling back to adjusting test2-package's dependencies recursively
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-old-package-dependency=2.0
DEBUG:root:falling back to adjusting test3-package's dependencies recursively
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-old-package-dependency=2.0
.
----------------------------------------------------------------------
Ran 1 test in 0.069s
OK
** Tags removed: verification-needed verification-needed-xenial
** Tags added: verification-done verification-done-xenial
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to unattended-upgrades in Ubuntu.
https://bugs.launchpad.net/bugs/1821101
Title:
unattended-upgrades: Fall back to adjusting more packages' candidates
when a package from an allowed origin can't be marked to
install/upgrade
Status in unattended-upgrades package in Ubuntu:
Fix Released
Status in unattended-upgrades source package in Xenial:
Fix Committed
Status in unattended-upgrades source package in Bionic:
Fix Released
Status in unattended-upgrades source package in Cosmic:
Fix Released
Bug description:
[Impact]
* Without the introduced fallbacks u-u could not upgrade particular package sets from -security. It could be observed in Cosmic with systemd security updates failing to install in:
https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-disco/disco/amd64/u/unattended-upgrades/20190318_182031_fe4fe@/log.gz
[Test Case]
* The fix includes the extension of the build-time test cases to
cover package sets with which u-u fails with without the fallback:
Running ./test_rewind.py with python3
DEBUG:root:APT::VersionedKernelPackages is not set
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:falling back to marking test2-package, then adjusting changes
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test3-package=2.0
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:falling back to marking test3-package, then adjusting changes
WARNING:root:package test3-package upgradable but fails to be marked for upgrade (E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.)
DEBUG:root:falling back to adjusting all packages
DEBUG:root:adjusting candidate version: test-package=2.0
DEBUG:root:adjusting candidate version: test2-package=2.0
DEBUG:root:adjusting candidate version: test2-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-old-package-dependency=2.0
DEBUG:root:adjusting candidate version: test3-package=2.0
WARNING:root:package z-package upgradable but fails to be marked for upgrade ()
.
----------------------------------------------------------------------
Ran 1 test in 0.039s
OK
[Regression Potential]
* When failing to mark a package to upgrade/install from the allowed origin holding the highest version the first fallback resets all already adjusted candidates to the highest available version irrespective to the origin of this version being allowed or not. This itself is not a risky operation and sanity checks later ensure that no package would be installed from not allowed origins but it can trigger code paths in apt that were not tried before and may crash.
* In testing apt's resolver failed to find a solution for upgrading packages with the first fallback raising an error, but the second fallback handles the error and tries adjusting _all_ potentially upgradable/installable package at the expense of using much more CPU time. This second fallback is not expected to be reached often (it is not reached in autopkgtests either) and adjusting all of those packages matches an earlier behavior of u-u, thus the slow-down may not be considered a regression.
[Other Info]
* If the second fallback is found to be reached often a different fallback can be introduced before the first one, to adjust all packages from the same source package then try again:
See: https://github.com/mvo5/unattended-upgrades/pull/175#discussion_r268226796
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1821101/+subscriptions
More information about the foundations-bugs
mailing list