unit-remains in goal state after being flagged for removal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Yang Kelvin Liu | ||
2.4 |
Fix Released
|
High
|
Yang Kelvin Liu |
Bug Description
Juju units may seem themselves in goal state, even after they have been flagged as removal. The unit being able to tell that it is doomed is my prime use case for charm goal state.
With postgresql/0 currently in an error state:
$ juju run --unit=postgresql/0 -- goal-state --format=yaml
units:
postgresql/0:
status: maintenance
since: 2018-06-20 07:42:58Z
relations: {}
$ juju add-unit postgresql
$ juju run --unit=postgresql/0 -- goal-state --format=yaml
units:
postgresql/0:
status: maintenance
since: 2018-06-20 07:42:58Z
postgresql/1:
status: waiting
since: 2018-06-20 09:00:11Z
relations: {}
$ juju remove-unit postgresql/0
removing unit postgresql/0
$ juju run --unit=postgresql/0 -- goal-state --format=yaml
units:
postgresql/0:
status: maintenance
since: 2018-06-20 07:42:58Z
postgresql/1:
status: waiting
since: 2018-06-20 09:00:11Z
relations: {}
Running 'juju debug-hooks postgresql/0' and resolving postgresql/0, I see that postgresql/0 remains in goal state throughout install & leader-
Similarly, in a separate test during a 'replication-
I have no use cases for goal-state unless this issue can be fixed, by which I mean that units should never appear in goal-state once the remove-unit or remove-application command has been accepted.
tags: | added: canonical-is |
Changed in juju: | |
milestone: | none → 2.5-beta1 |
status: | New → Triaged |
importance: | Undecided → High |
Changed in juju: | |
status: | Fix Committed → Fix Released |
To confirm the fix here - the "status" of a unit will show as "dying" once remove-application has been run and the unit transitions to running its departed hooks etc so it can leave scope. Until then, while the unit is still alive, "status" will show the workload status, "maintenance", "waiting", "alive" etc. And when the unit becomes "dead" after all hooks have been run and it has left scope, it won't show up at all.