cli: Remove images of a deleted pool without their data #189

Open
koolkhel wants to merge 3 commits from koolkhel/vitastor:rm-image-deleted-pool into master

3 Commits

Author SHA1 Message Date
aff08c5847 cli: Expect EINVAL from rm in a pool with an invalid configuration
The test accepted any non-zero exit code there, so a hang killed by
timeout (124) passed it as well.
2026-11-26 08:30:08 +03:00
d1f473822a cli: Skip data in rm only for pools missing from /config/pools
pool_config's exists flag is also false for a pool whose configuration
fails validation, for example one written by a newer version, and rm
then removed such a pool's images without their data. Track the pool
IDs present in /config/pools and remove a layer without its data only
when its pool is not there.

Refuse to remove layers with children when a pool of the merge is
deleted: merging needs the data, and the CLI crashed on the missing
pool. Print the warning about the skipped data with --json too.
2026-11-26 02:17:35 +03:00
4a30eb2f5a cli: Remove images of a deleted pool without their data
rm-pool --force leaves the pool's images in /config/inode, and rm could
never remove them: it marked the image deleted and then failed with
"Pool does not exist", or hung while the monitor was still removing the
pool's PGs, because the pool stays in pool_config with exists=false
until then.

Skip the data of a layer whose pool is gone and remove only its
metadata. Treat a pool with exists=false as missing in rm-data and in
rm's statistics read too, so neither waits for PGs of a deleted pool.
2026-11-25 20:14:23 +03:00