Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lvmthin on top of lvmvdo - space of removed thin snapshots of thin volumes is not discarded on lvmvdo #150

Open
maurerh opened this issue Jul 10, 2024 · 1 comment

Comments

@maurerh
Copy link

maurerh commented Jul 10, 2024

Hi

I am running LVM2 2.03.24.
When I create a thinpool on top of LVM using

lvcreate --type thin-pool -n lv_data_pool -L 350G --pooldatavdo y VolGroupVDO  --chunksize 64k
lvrename VolGroupVDO/lv_data_pool_vpool0 VolGroupVDO/lv_data_vdo_vpool0
lvextend --poolmetadatasize 16G VolGroupVDO/lv_data_pool
lvextend -L+1650G VolGroupVDO/lv_data_pool
lvcreate  --thin VolGroupVDO/lv_data_pool --virtualsize 1T --name lvdata

This leads to the following LVM setup

  lv_data_pool               VolGroupVDO twi-a-t---   1,95t                           0,00   0,15
  [lv_data_pool_tdata]       VolGroupVDO vwi-aov---   1,95t lv_data_vdo_vpool0        0,00
  [lv_data_pool_tmeta]       VolGroupVDO ewi-ao---- <15,88g
  lv_data_vdo_vpool0         VolGroupVDO dwi------- 350,00g                           1,21
  [lv_data_vdo_vpool0_vdata] VolGroupVDO Dwi-ao---- 350,00g
  lvdata                     VolGroupVDO Vwi-a-t---   1,00t lv_data_pool              0,00
  [lvol0_pmspare]            VolGroupVDO ewi------- <15,88g

If I write data to the filesystem and delete it, discards work on vdo layer and space is discared as expected and
vdostats --hu
reduces the usage.
VolGroupVDO-lv_data_vdo_vpool0-vpool 350.0G 4.2G 345.8G 1% 99%

If I write data to the file system, create a thin snapshot with
lvcreate -s --name lvdata_s1 VolGroupVDO/lvdata
delete the data in the original filesystem, the usage of vdo does not change as expected.

But if i delete the snapshot, with
lvremove VolGroupVDO/lvdata_s1
I would expect, that the VDO space is freed.
But this is not the case, the usage vdostats --hu does not change
I am using

        issue_discards = 1
        thin_pool_discards = "passdown"
        thin_pool_zero = 1

therefore discards should be passed down to VDO

lvs -o  name,discards
  LV                 Discards
  lvroot                     
  lvswap                     
  lvvar                      
  lv_data_pool       passdown
  lv_data_vdo_vpool0         
  lvdata             passdown
  lvdata_s1          passdown

Therefore the space of deleted snapshots continuously cumulate, and at some point the VDO volume runs out of space, even if I create only some data and all thin snapshots are deleted.

How can I free VDO space, when I delete an thin-snapshot of a thin volume on top of VDO.

Regards

Hansjörg

@zkabelac
Copy link
Contributor

Yep - this feature is still in devel ATM - there are more troubles along this route.
Meanwhile - until resolved - you can run 'blkdiscard /dev/vg/lv' before dropping thin volume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants