Skip to content

Removal/cleanup hooks not implemented #1550

@nvinuesa

Description

@nvinuesa

While investigating the Juju issue juju/juju#21860 I found out that what was actually happening is that the postgresql (16/edge) charm was never releasing the storage (looks like one of the snaps is still running). This prevents the correct storage removal which itself prevents the machine removal which prevents the graceful model removal. This works of course if we run destroy-model --force ....
The storage of the model after running model destroy is the following:

  Storage Unit  Storage ID  Type        Status     Message                                                
                data/10     filesystem  detaching  umount failed: umount:                                 
  /var/snap/charmed-postgresql/common/var/lib/postgresql: target is busy.: exit status 32                 
...
                logs/3      filesystem  detaching  umount failed: umount:                               
  /var/snap/charmed-postgresql/common/data/logs: target is busy.: exit status 32                          

After discussing with @marceloneppel we came to the conclusion that the removal-related hooks handlers are not implemented yet in the postgresql charm (namely stop or storage-detaching).

Note: One important implementation detail is that the storage detaching and removal in Juju happens in a concurrent worker with retries. This means that even if the snaps are definitely stopped during the stop hook (which will run after storage-detaching) it will not block the eventual storage removal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions