Bug 1399292

Summary: lvreduce succeeded on a cached LV
Product: [Community] LVM and device-mapper Reporter: rasoso
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Changing Logical Volumes QA Contact: cluster-qe <cluster-qe>
Status: POST --- Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, msnitzer, prajnoha, zkabelac
Version: 2.02.167Flags: rule-engine: lvm-technical-solution?
rule-engine: lvm-test-coverage?
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description rasoso 2016-11-28 17:06:36 UTC
Description of problem:

(This comes after a discussion on irc.)
lvreduce succeeded on a cached LV, although this is not fully supported yet.
This resulted in <LV> and <LV>_corig having different sizes.
The cache cannot be removed anymore ("Command failed with status code 5." for lvconvert, lvremove).

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

# lvreduce --version
LVM version:     2.02.167(2) (2016-11-05)
Library version: 1.02.136 (2016-11-05)
Driver version:  4.35.0
(packages from debian release "stretch")


How reproducible:

Did not try to reproduce.

Actual results:

# lvs -a
LV                  VG        Attr       LSize   Pool          Origin       Data%  Meta%  Move Log Cpy%Sync Convert
[DataLVcache]       vg Cwi---C--- 450.00g                            3.55   8.36            0.00
[DataLVcache_cdata] vg Cwi-ao---- 450.00g
[DataLVcache_cmeta] vg ewi-ao----   1.00g
home                vg Cwi-aoC---   2.00t [DataLVcache] [home_corig] 3.55   8.36            0.00
[home_corig]        vg owi-aoC---   3.62t
[lvol0_pmspare]     vg ewi-------   1.00g
root                vg -wi-ao----   8.38g
swap_1              vg -wi-ao----  11.75g
var                 vg -wi-ao----   2.79g

home is 2.00t after lvreduce, whereas [home_corig] is still 3.62t


Expected results:
- The "lvreduce" command should warn that the operation is not fully supported yet, and should fail.
- home and [home_corig] volumes should keep the same size
- subsequent commands to remove the cache should not fail with "Command failed with status code 5."

Additional info:
Thanks to kabi_ for help on irc.

Comment 2 Zdenek Kabelac 2017-01-10 08:46:21 UTC
Fixed upstream: 

https://www.redhat.com/archives/lvm-devel/2017-January/msg00010.html