config-changed hook caused a package upgrade on gnocchi unit

Bug #1973303 reported by Márton Kiss
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Gnocchi Charm
Fix Committed
High
Edward Hope-Morley
charms.openstack
In Progress
Undecided
Edward Hope-Morley

Bug Description

On a customer environment where they would like to make the package upgrades part of a separate and planned operations with Landscape, we saw that a trigger of config-changed hook fired an apt-dist upgrade and upgraded the packages.

unit-gnocchi-log.0:

2022-05-10 12:04:09 INFO juju-log Reactive main running for hook config-changed
2022-05-10 12:04:09 INFO juju-log Invoking reactive handler: reactive/gnocchi_handlers.py:108:render_config
2022-05-10 12:04:10 INFO juju-log Performing OpenStack upgrade to ussuri.
2022-05-10 12:04:12 INFO juju-log Upgrading with options: ['--option', 'Dpkg::Options::=--force-confnew', '--option', 'Dpkg::Options::=--force-confdef']
2022-05-10 12:04:59 INFO juju-log Installing ['gnocchi-api', 'gnocchi-metricd', 'python3-apt', 'ceph-common', 'python3-rados', 'python3-keystonemiddleware', 'python3-memcache', 'python3-boto3', 'memcached', 'python3-memcache', 'haproxy', 'apache2'] with options: ['--option', 'Dpkg::Options::=--force-confnew', '--option', 'Dpkg::Options::=--force-confdef']

/var/log/apt/history.log:

Start-Date: 2022-05-10 12:04:14
Commandline: apt-get --assume-yes --option Dpkg::Options::=--force-confnew --option Dpkg::Options::=--force-confdef dist-upgrade

https://git.launchpad.net/charm-gnocchi/tree/src/reactive/gnocchi_handlers.py#n120

The config changed hook is calling the render_config() and it is doing a package upgrade. The config-changed hook was caused by a juju controller upgrade. Ideally it would be great to separate the package upgrades from the config changed hooks.

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

I'm slightly confused by this. Was this with action-managed-upgrade=false (default), and a change to the openstack-origin from what was currently installed?

It looks like the charm was processing an OpenStack upgrade (which would be true if the openstack-origin specified a different OpenStack version than that which was installed), but would be a bug if the openstack-origin hadn't been changed. The call to "upgrade_if_availble()" should be a no-op if no upgrade is 'requested' via the openstack-origin.

Thanks.

Changed in charm-gnocchi:
status: New → Incomplete
Revision history for this message
Arif Ali (arif-ali) wrote :

@alex @marton

I ran the config-changed hook in my lab (manually), to see if I can replicate. I was able to see in the log, where it says "Performing OpenStack upgrade to ussuri" as shown in [1].

I am presuming that a config-changed shouldn't be upgrading any packages?

[1] https://paste.ubuntu.com/p/xBWhXdK9W5/

Revision history for this message
Márton Kiss (marton-kiss) wrote :

This site was deployed on Focal/Ussuri by default, and the openstack-origin was not changed.

Arif Ali (arif-ali)
Changed in charm-gnocchi:
status: Incomplete → New
Revision history for this message
Liam Young (gnuoy) wrote :

This is down to some issue with the charm working out what release is deployed. Currently the charm on ussuri thinks its at train. This is partly down to the package codenames dict in the charm (it stops at train) and partly down to gnocchi not bumping the code major revision along with openstack releases.

Changed in charm-gnocchi:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Liam Young (gnuoy)
Changed in charm-gnocchi:
assignee: Liam Young (gnuoy) → nobody
status: In Progress → New
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-gnocchi (master)
Changed in charm-gnocchi:
status: New → In Progress
Changed in charm-gnocchi:
assignee: nobody → Edward Hope-Morley (hopem)
Revision history for this message
Edward Hope-Morley (hopem) wrote :
Changed in charms.openstack:
assignee: nobody → Edward Hope-Morley (hopem)
status: New → In Progress
Revision history for this message
Edward Hope-Morley (hopem) wrote :

Some extra information about this bug is that it appears to only impact Openstack releases < Yoga since above that the installed release is obtained from /etc/openstack-release (if a UCA is not installed) rather than inferring from the package version.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charms.openstack (master)

Reviewed: https://review.opendev.org/c/openstack/charms.openstack/+/916791
Committed: https://opendev.org/openstack/charms.openstack/commit/55f98e80e430b1112c38b90d88e10bd0923daa6f
Submitter: "Zuul (22348)"
Branch: master

commit 55f98e80e430b1112c38b90d88e10bd0923daa6f
Author: Edward Hope-Morley <email address hidden>
Date: Tue Apr 23 14:47:08 2024 +0100

    Support same pkg version for multiple releases

    It is possible for the version of a package to remain the same
    across multiple releases of openstack so this adds support to
    get_os_codename_package() to allow this.

    If releases A, B and C have version N and we are on release B
    this will return release C so that it does not look like there
    is an upgrade necessary. The main change here that allows this
    is to support matching major and minor version up to X.Y.Z as
    opposed to previously only matching the major version X.

    Related-Bug: #1973303

    Change-Id: I138f61312efb728544276483b1a459b9eeecafdb

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-gnocchi (master)

Reviewed: https://review.opendev.org/c/openstack/charm-gnocchi/+/916783
Committed: https://opendev.org/openstack/charm-gnocchi/commit/ce8fd528ed2fa01c31fa231e85a83cef285b1887
Submitter: "Zuul (22348)"
Branch: master

commit ce8fd528ed2fa01c31fa231e85a83cef285b1887
Author: Edward Hope-Morley <email address hidden>
Date: Tue Apr 23 12:39:27 2024 +0100

    Update package version codenames

    Codenames stopped at Train so this fills gap
    all the way to Caracal as well as accounting
    for releases that share the version. Where more
    than one release shares the same version we set
    the highest release as the named release for that
    version to avoid unnecessary upgrades.

    Closes-Bug: #1973303
    Change-Id: I048921beb6aaa66563d83253efb6152caa315ba9

Changed in charm-gnocchi:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charms.openstack (stable/caracal)

Related fix proposed to branch: stable/caracal
Review: https://review.opendev.org/c/openstack/charms.openstack/+/918739

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charms.openstack (stable/bobcat)

Related fix proposed to branch: stable/bobcat
Review: https://review.opendev.org/c/openstack/charms.openstack/+/918740

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charms.openstack (stable/antelope)

Related fix proposed to branch: stable/antelope
Review: https://review.opendev.org/c/openstack/charms.openstack/+/918741

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charms.openstack (stable/caracal)

Reviewed: https://review.opendev.org/c/openstack/charms.openstack/+/918739
Committed: https://opendev.org/openstack/charms.openstack/commit/b956245392babe61f401f09979db07f98e9cb29b
Submitter: "Zuul (22348)"
Branch: stable/caracal

commit b956245392babe61f401f09979db07f98e9cb29b
Author: Edward Hope-Morley <email address hidden>
Date: Tue Apr 23 14:47:08 2024 +0100

    Support same pkg version for multiple releases

    It is possible for the version of a package to remain the same
    across multiple releases of openstack so this adds support to
    get_os_codename_package() to allow this.

    If releases A, B and C have version N and we are on release B
    this will return release C so that it does not look like there
    is an upgrade necessary. The main change here that allows this
    is to support matching major and minor version up to X.Y.Z as
    opposed to previously only matching the major version X.

    Related-Bug: #1973303

    Change-Id: I138f61312efb728544276483b1a459b9eeecafdb
    (cherry picked from commit 55f98e80e430b1112c38b90d88e10bd0923daa6f)

tags: added: in-stable-caracal
tags: added: in-stable-bobcat
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charms.openstack (stable/bobcat)

Reviewed: https://review.opendev.org/c/openstack/charms.openstack/+/918740
Committed: https://opendev.org/openstack/charms.openstack/commit/442fa364913afcb1acd1f502bd5c980f3f831888
Submitter: "Zuul (22348)"
Branch: stable/bobcat

commit 442fa364913afcb1acd1f502bd5c980f3f831888
Author: Edward Hope-Morley <email address hidden>
Date: Tue Apr 23 14:47:08 2024 +0100

    Support same pkg version for multiple releases

    It is possible for the version of a package to remain the same
    across multiple releases of openstack so this adds support to
    get_os_codename_package() to allow this.

    If releases A, B and C have version N and we are on release B
    this will return release C so that it does not look like there
    is an upgrade necessary. The main change here that allows this
    is to support matching major and minor version up to X.Y.Z as
    opposed to previously only matching the major version X.

    Related-Bug: #1973303

    Change-Id: I138f61312efb728544276483b1a459b9eeecafdb
    (cherry picked from commit 55f98e80e430b1112c38b90d88e10bd0923daa6f)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charms.openstack (stable/antelope)

Reviewed: https://review.opendev.org/c/openstack/charms.openstack/+/918741
Committed: https://opendev.org/openstack/charms.openstack/commit/eda7104667fa9db2f6cd14fb5e69b2c0943b13e9
Submitter: "Zuul (22348)"
Branch: stable/antelope

commit eda7104667fa9db2f6cd14fb5e69b2c0943b13e9
Author: Edward Hope-Morley <email address hidden>
Date: Tue Apr 23 14:47:08 2024 +0100

    Support same pkg version for multiple releases

    It is possible for the version of a package to remain the same
    across multiple releases of openstack so this adds support to
    get_os_codename_package() to allow this.

    If releases A, B and C have version N and we are on release B
    this will return release C so that it does not look like there
    is an upgrade necessary. The main change here that allows this
    is to support matching major and minor version up to X.Y.Z as
    opposed to previously only matching the major version X.

    Related-Bug: #1973303

    Change-Id: I138f61312efb728544276483b1a459b9eeecafdb
    (cherry picked from commit 55f98e80e430b1112c38b90d88e10bd0923daa6f)

tags: added: in-stable-antelope
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-gnocchi (stable/2024.1)

Fix proposed to branch: stable/2024.1
Review: https://review.opendev.org/c/openstack/charm-gnocchi/+/919103

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-gnocchi (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/charm-gnocchi/+/919104

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-gnocchi (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/charm-gnocchi/+/919105

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-gnocchi (stable/2024.1)

Reviewed: https://review.opendev.org/c/openstack/charm-gnocchi/+/919103
Committed: https://opendev.org/openstack/charm-gnocchi/commit/f69ea045d1cce09e942062324d43e104b83d693f
Submitter: "Zuul (22348)"
Branch: stable/2024.1

commit f69ea045d1cce09e942062324d43e104b83d693f
Author: Edward Hope-Morley <email address hidden>
Date: Tue Apr 23 12:39:27 2024 +0100

    Update package version codenames

    Codenames stopped at Train so this fills gap
    all the way to Caracal as well as accounting
    for releases that share the version. Where more
    than one release shares the same version we set
    the highest release as the named release for that
    version to avoid unnecessary upgrades.

    Closes-Bug: #1973303
    Change-Id: I048921beb6aaa66563d83253efb6152caa315ba9
    (cherry picked from commit ce8fd528ed2fa01c31fa231e85a83cef285b1887)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-gnocchi (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/charm-gnocchi/+/919104
Committed: https://opendev.org/openstack/charm-gnocchi/commit/4004ffbb2edf23b975893a67cbe358e0b84be985
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 4004ffbb2edf23b975893a67cbe358e0b84be985
Author: Edward Hope-Morley <email address hidden>
Date: Tue Apr 23 12:39:27 2024 +0100

    Update package version codenames

    Codenames stopped at Train so this fills gap
    all the way to Caracal as well as accounting
    for releases that share the version. Where more
    than one release shares the same version we set
    the highest release as the named release for that
    version to avoid unnecessary upgrades.

    Closes-Bug: #1973303
    Change-Id: I048921beb6aaa66563d83253efb6152caa315ba9
    (cherry picked from commit ce8fd528ed2fa01c31fa231e85a83cef285b1887)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-gnocchi (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/charm-gnocchi/+/919105
Committed: https://opendev.org/openstack/charm-gnocchi/commit/871ca8fdd3708ff5909a81eadcda8c26da435969
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 871ca8fdd3708ff5909a81eadcda8c26da435969
Author: Edward Hope-Morley <email address hidden>
Date: Tue Apr 23 12:39:27 2024 +0100

    Update package version codenames

    Codenames stopped at Train so this fills gap
    all the way to Caracal as well as accounting
    for releases that share the version. Where more
    than one release shares the same version we set
    the highest release as the named release for that
    version to avoid unnecessary upgrades.

    Closes-Bug: #1973303
    Change-Id: I048921beb6aaa66563d83253efb6152caa315ba9
    (cherry picked from commit ce8fd528ed2fa01c31fa231e85a83cef285b1887)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.