Bug 812965 - lvresize does not release the deleted blocks after reducing the thin disk size
lvresize does not release the deleted blocks after reducing the thin disk size
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
17
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Zdenek Kabelac
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-16 12:45 EDT by Xiaowei Li
Modified: 2015-01-26 19:10 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-01 14:14:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Xiaowei Li 2012-04-16 12:45:08 EDT
Description of problem:
lvresize does not release the deleted blocks after reducing the thin disk size

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:                 
[root@laker ~]# dd if=/dev/zero of=/dev/vg/tp bs=1M count=100

[root@laker ~]# lvs vg
  LV   VG   Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  pool vg   twi-a-tz 200.00m              50.00                        
  tp   vg   Vwi-a-tz 100.00m pool        100.00   

[root@laker ~]# lvresize -L -50M vg/tp

[root@laker ~]# lvs vg
  LV   VG   Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  pool vg   twi-a-tz 200.00m              50.00                        
  tp   vg   Vwi-a-tz  52.00m pool        192.31            

  
Actual results:
The allocated blocks are still 100(50%) after reducing the thin disk size to 50M. 

Expected results:
The allocated blocks should be 50(25%)

Additional info:
Comment 1 Zdenek Kabelac 2012-04-17 04:51:54 EDT
Yes - known issue - we will need to provide some policy how to handle downsize of thin LV in this case - the problem here is - for normal volume you'd always chance to step back if you make a mistake -  but if the pool would immediately release block from unused part a resized device - we could never get them back. Also the much better use will be when there will be supported real discard over pool device - which is going to be part of 3.4 kernel.

There might be few way how to handle this - we may have policy to release block with resize - and there would be no way back. Or we may keep history of max size of device and try to drop blocks when we the pool is getting overfilled. Another way might be to provide some  'pool flush' command which would drop discard unused block in pool making it a point of no return.  It's also releated to vgcfgrestore issue we currently do not have resolved.
Comment 2 Xiaowei Li 2012-05-07 03:23:23 EDT
(In reply to comment #1)
> Yes - known issue - we will need to provide some policy how to handle downsize
> of thin LV in this case - the problem here is - for normal volume you'd always
> chance to step back if you make a mistake -  but if the pool would immediately
> release block from unused part a resized device - we could never get them back.
> Also the much better use will be when there will be supported real discard over
> pool device - which is going to be part of 3.4 kernel.
> 
> There might be few way how to handle this - we may have policy to release block
> with resize - and there would be no way back. Or we may keep history of max
> size of device and try to drop blocks when we the pool is getting overfilled.
> Another way might be to provide some  'pool flush' command which would drop
> discard unused block in pool making it a point of no return.  It's also
> releated to vgcfgrestore issue we currently do not have resolved.

We cannot discard the used blocks and the thin-lv's size is virtual size. 
So we should make sure that the min size of thin LV is not less than the already allocated size while doing lvreduce.

Also i don't think lvm knows which allocated block is used or not by the application. So another suggestion, we should integrate fstrim with lvm thin-reclaim since the file system should know if the block is used.(currently the fstrim cannot discard unused block on the file system on the thin LV)
Comment 3 Fedora End Of Life 2013-07-04 02:37:54 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. 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 WONTFIX if it remains open with a Fedora 
'version' of '17'.

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 prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 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 to Fedora 17's end of life.

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.
Comment 4 Fedora End Of Life 2013-08-01 14:14:22 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 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.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.