Red Hat Bugzilla – Bug 1314292
[RFE] add discard support for lvremove of thin volumes
Last modified: 2016-12-20 14:12:42 EST
Description of problem:
When lvremove is used to remove a lv from a thinpool, lvremove asks whether to DISCARD it, but it does not discard the blocks.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. lvcreate --name test -V 1G --thinpool ssd/thinp
2. lvremove /dev/ssd/test
3. Answer y to "Do you really want to remove and DISCARD active logical volume test? [y/n]:"
lv is removed without discarding blocks
blocks used by the LV should be discarded
Discards can be monitored with strace or
blktrace -a issue -d /dev/sda -o - | blkparse -i - | grep 'D.*D'
(In reply to Till Maas from comment #0)
> Description of problem:
> When lvremove is used to remove a lv from a thinpool, lvremove asks whether
> to DISCARD it, but it does not discard the blocks.
This is misunderstanding of 'issue_discard' lvm.conf option.
This option specifies what is going to happen with just released 'extents' in your VG - while when you remove any 'thin' LV there are no released extents.
They all still belong to running thin-pool - which is the 'exclusive' owner of
Note - there was a bug in some fc23 kernel where discard support has got broken, so make sure you have the right kernel.
But when you release thin in thin-pool - you should see instant drop
of used space (if your LV was holding exclusively provisioned blocks).
(In reply to Zdenek Kabelac from comment #1)
> This option specifies what is going to happen with just released 'extents'
> in your VG - while when you remove any 'thin' LV there are no released
> They all still belong to running thin-pool - which is the 'exclusive' owner
lvremove says it will discard the blocks:
"Do you really want to remove and DISCARD active logical volume test? [y/n]:"
So if lvremove is expected to not discard the blocks, then the prompt needs to be changed, therefore this is still a bug IMHO.
Nevertheless, it also makes sense to discard the blocks, even if they still belong to a thinpool, therefore I hope you will implement this, even if this is a feature request and the bad prompt is the bug at the moment.
> Note - there was a bug in some fc23 kernel where discard support has got
> broken, so make sure you have the right kernel.
> But when you release thin in thin-pool - you should see instant drop
> of used space (if your LV was holding exclusively provisioned blocks).
discard works with the kernel, but lvm2 uses bad code to figure out whether discard is supported as reported in bug 1313377
Comment https://bugzilla.redhat.com/show_bug.cgi?id=1313377#c6 from Alasdair Kergon:
| Yes, lvremove ought to be able to discard thin volumes before removing them. | We need to fix that.
So switching to 'RFE' as that's nontrivial amount of work.
Kernel target on its own is not discarding released chunks and such discard is supposed to happen within user-space context.
Discard itself on large volume might take quite while so it's not viable to be made while holding VG lock.
As a 'workaround' user may ATM run 'blkdiscard' prior calling lvremove.
For now LV support only discards an 'empty' PV space - but in this case where thin-pool is still holder of released space, we cannot follow the meaning of issue_discard - and will need to extend it to allow running discard while
LV is still active (so there are going to be races to think about).
The work on such discard support is likely related to fixing prompt for lvremove
and also removal of mutliple LVs efficiently (i.e. when whole pool is removed
we should not slowly discard individual thin LVs)
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora 'version'
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 23 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.