Root password update via config can cause hook error

Bug #1838125 reported by Liam Young
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Percona Cluster Charm
Fix Released
High
Liam Young

Bug Description

This bug is down to hook ordering and the caching of the config context.

1) Root password via config
2) An update-status hook *1 is already queued on unitX
3) unitX runs update-status which does not act on the password change but does cache the new config value
4) config-changed hook runs on unitX, config().changed('root-password') reports no change and the password is not updated.

Reproduce: This is slightly artificial but illustrates the point.

1) Enter a debug-hooks session on unitX.
2) Change the root password via config.
3) In the config-changed session on unitX run the update-status script *not* config-changed.
4) Change an unrelated option via config like nagios_context="foo".
5) Run the config-changed hook on unitX. After the hook completes the root password on unitX is still the old value and does not match what is in the leaderdb or charm config.

Liam Young (gnuoy)
Changed in charm-percona-cluster:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Liam Young (gnuoy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-percona-cluster (master)

Fix proposed to branch: master
Review: https://review.opendev.org/673132

Changed in charm-percona-cluster:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/673577

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

Reviewed: https://review.opendev.org/673577
Committed: https://git.openstack.org/cgit/openstack/charm-percona-cluster/commit/?id=e27006e98b9d0c090c2b07ead0ef12cd1630fe03
Submitter: Zuul
Branch: master

commit e27006e98b9d0c090c2b07ead0ef12cd1630fe03
Author: Liam Young <email address hidden>
Date: Tue Jul 30 15:57:01 2019 +0000

    Switch to using DDL for root password update

    Using DDL for the root password update triggers the cluster to
    replicate the password rather than relying on the charm to apply it
    to each unit. This means that only the leader should update the
    password.

    To avoid a password update via config being missed the implicit save
    of config data is turned off on update-status hooks.

    Change-Id: I00fe3c7c32a000c6b697263a9ad32273515952a7
    Closes-Bug: #1838124
    Closes-Bug: #1838125

Changed in charm-percona-cluster:
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-percona-cluster:
milestone: none → 19.07
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-percona-cluster (master)

Change abandoned by Liam Young (<email address hidden>) on branch: master
Review: https://review.opendev.org/673132
Reason: Superseded by later change

David Ames (thedac)
Changed in charm-percona-cluster:
status: Fix Committed → Fix Released
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.