Start hook executed erroneously during series upgrade.

Bug #1890774 reported by Tim Penhey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Achilleas Anagnostopoulos

Bug Description

During upgrade-series, no hooks should be run between pre-series-upgrade and post-series-upgrade.

Reproducer (assuming running from the juju source for 2.8.1 release):

    juju bootstrap lxd series-test
    juju deploy ./acceptancetests/repository/charms/dummy-sink --series xenial
    juju deploy ./acceptancetests/repository/charms/dummy-subordinate --series xenial
    juju relate dummy-sink dummy-subordinate
    juju config dummy-subordinate token=canonical
    watch -c juju status --color
    juju upgrade-series 0 prepare bionic
    juju run --machine 0 'sudo shutdown -r now'

Then ssh'ed to machine 0

/var/log/juju$ cat machine-lock.log
[snip]
2020-08-07 04:30:47 unit-dummy-subordinate-0: uniter (run pre-series-upgrade hook), waited 0s, held 0s
2020-08-07 04:30:47 unit-dummy-sink-0: uniter (run pre-series-upgrade hook), waited 0s, held 0s
2020-08-07 04:31:31 === agent unit-dummy-subordinate-0 started ===
2020-08-07 04:31:32 unit-dummy-subordinate-0: uniter (run start hook), waited 0s, held 0s
2020-08-07 04:31:31 === agent unit-dummy-sink-0 started ===
2020-08-07 04:31:32 unit-dummy-sink-0: uniter (run start hook), waited 0s, held 0s

When the unit was rebooted, since the uniter was in an upgrade-series state, it shouldn't be running the start hook.

I ran the `sudo do-release-upgrade -f DistUpgradeViewNonInteractive` to upgrade from xenial to bionic, and rebooted.

After the machine agent came up, I ran 'juju upgrade-series 0 complete'

$ juju upgrade-series 0 complete
machine-0 complete phase started
machine-0 started unit agents after series upgrade
dummy-sink/0 post-series-upgrade hook running
dummy-sink/0 post-series-upgrade completed
dummy-subordinate/0 post-series-upgrade hook running
dummy-subordinate/0 post-series-upgrade hook not found, skipping

Upgrade series for machine "0" has successfully completed

You can see from the machine lock output that the start hook was called again after the reboot, but before the post-series-upgrade hook.

2020-08-07 04:42:00 === agent unit-dummy-sink-0 started ===
2020-08-07 04:42:01 unit-dummy-sink-0: uniter (run start hook), waited 0s, held 1s
2020-08-07 04:42:00 === agent unit-dummy-subordinate-0 started ===
2020-08-07 04:42:01 unit-dummy-subordinate-0: uniter (run start hook), waited 1s, held 0s
2020-08-07 04:42:50 unit-dummy-sink-0: uniter (run post-series-upgrade hook), waited 0s, held 0s
2020-08-07 04:42:50 unit-dummy-subordinate-0: uniter (run post-series-upgrade hook), waited 0s, held 0s
2020-08-07 04:47:25 unit-dummy-sink-0: uniter (run update-status hook), waited 0s, held 0s
2020-08-07 04:47:25 unit-dummy-subordinate-0: uniter (run update-status hook), waited 0s, held 0s

Changed in juju:
assignee: nobody → Achilleas Anagnostopoulos (achilleasa)
Changed in juju:
status: Triaged → In Progress
Revision history for this message
Achilleas Anagnostopoulos (achilleasa) wrote :

PR https://github.com/juju/juju/pull/11887 includes a fix for 2.8

Changed in juju:
milestone: 2.8-next → 2.8.2
status: In Progress → Fix Committed
Changed in juju:
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.