Skip to content

Commit e4f68bc

Browse files
committed
docs(charm): fix storage-detaching ordering comment
The storage-detaching hook runs before relation-departed/stop on all Juju versions, not just 4.0; what is 4.0-specific is that 3.6 force-removes still-Dying storage (masking the stuck mount) while 4.0 leaves it to unmount. The comment conflated the two. Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
1 parent 28225fb commit e4f68bc

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/charm.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,10 +2569,11 @@ def _install_snap_package(
25692569

25702570
def _on_storage_detaching(self, _) -> None:
25712571
"""Stop the workload so Juju can unmount the storage on teardown or scale-down."""
2572-
# storage-detaching runs before relation-departed/stop on Juju 4.0 and nothing
2573-
# else stops the snap. On scale-down drop this unit from raft via a surviving
2574-
# peer first (a node can't remove itself, and once stopped the leader can no
2575-
# longer resolve its member IP to remove it), then stop so Juju can unmount.
2572+
# storage-detaching runs before the relation-departed/stop hooks and nothing
2573+
# else stops the snap, so stop it here or the mount stays busy. (3.6 force-removes
2574+
# still-Dying storage and masks this; 4.0 leaves it for Juju to unmount.) On
2575+
# scale-down drop this unit from raft via a surviving peer first — a node can't
2576+
# remove itself, and once stopped the leader can no longer resolve its member IP.
25762577
if self.app.planned_units() > 0:
25772578
self._remove_from_raft_via_peer()
25782579
self._observer.stop_observer()

0 commit comments

Comments
 (0)