Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 973419

Summary: thin pool mda device swapping doesn't work
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
Status: CLOSED CURRENTRELEASE QA Contact: Cluster QE <mspqa-list>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, thornber, zkabelac
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1006062 (view as bug list) Environment:
Last Closed: 2014-06-13 12:31:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1006062    

Description Corey Marthaler 2013-06-11 22:00:10 UTC
Description of problem:
# From man page
--poolmetadata ThinPoolMetadataLogicalVolume{Name|Path}
   Specifies thin pool metadata logical volume.  The size should be in between 2MiB and 16GiB.  Thin pool is specified with the option  --thinpool.   When
  the  specified  thin  pool  already  exists, the thin pool's metadata volume will be swapped with the given LV.  Properties of the thin pool like chunk

[root@qalvm-01 ~]# lvcreate -n newMDA -L 8M snapper_thinp
  Logical volume "newMDA" created
[root@qalvm-01 ~]# lvs -a -o +devices
  LV           VG            Attr      LSize  Pool Origin Devices
  POOL         snapper_thinp twi---tz-  5.00g             POOL_tdata(0)
  [POOL_tdata] snapper_thinp Twi---t--  5.00g             /dev/vdh1(0)
  [POOL_tdata] snapper_thinp Twi---t--  5.00g             /dev/vdg1(0)
  [POOL_tdata] snapper_thinp Twi---t--  5.00g             /dev/vdf1(0)
  [POOL_tmeta] snapper_thinp ewi---t--  8.00m             /dev/vdd1(0)
  newMDA       snapper_thinp -wi-a----  8.00m             /dev/vdf1(258)
  origin       snapper_thinp Vwi---tz-  1.00g POOL
  other1       snapper_thinp Vwi---tz-  1.00g POOL
  other2       snapper_thinp Vwi---tz-  1.00g POOL
  other3       snapper_thinp Vwi---tz-  1.00g POOL
  other4       snapper_thinp Vwi---tz-  1.00g POOL
  other5       snapper_thinp Vwi---tz-  1.00g POOL
  snap1        snapper_thinp Vwi---tz-  1.00g POOL origin

[root@qalvm-01 ~]# lvconvert --poolmetadata snapper_thinp/newMDA --thinpool snapper_thinp/POOL
Do you want to swap metadata of snapper_thinp/POOL pool with volume snapper_thinp/newMDA? [y/n]: y
  Check of thin pool snapper_thinp/POOL failed (status:1). Manual repair required (thin_dump --repair /dev/mapper/snapper_thinp-POOL_tmeta)!
  Failed to activate pool logical volume snapper_thinp/POOL.

[root@qalvm-01 ~]# lvremove snapper_thinp
Removing pool "POOL" will remove 7 dependent volume(s). Proceed? [y/n]: y
  Check of thin pool snapper_thinp/POOL failed (status:1). Manual repair required (thin_dump --repair /dev/mapper/snapper_thinp-POOL_tmeta)!
  Failed to update thin pool POOL.
  Failed to update thin pool POOL.
  Failed to update thin pool POOL.
  Failed to update thin pool POOL.
  Failed to update thin pool POOL.
  Failed to update thin pool POOL.
  Failed to update thin pool POOL.
  Logical volume "newMDA" successfully removed


Version-Release number of selected component (if applicable):
3.8.0-0.40.el7.x86_64

lvm2-2.02.99-0.46.el7    BUILT: Tue Jun  4 19:27:58 CDT 2013
lvm2-libs-2.02.99-0.46.el7    BUILT: Tue Jun  4 19:27:58 CDT 2013
lvm2-cluster-2.02.99-0.46.el7    BUILT: Tue Jun  4 19:27:58 CDT 2013
device-mapper-1.02.78-0.46.el7    BUILT: Tue Jun  4 19:27:58 CDT 2013
device-mapper-libs-1.02.78-0.46.el7    BUILT: Tue Jun  4 19:27:58 CDT 2013
device-mapper-event-1.02.78-0.46.el7    BUILT: Tue Jun  4 19:27:58 CDT 2013
device-mapper-event-libs-1.02.78-0.46.el7    BUILT: Tue Jun  4 19:27:58 CDT 2013
cmirror-2.02.99-0.46.el7    BUILT: Tue Jun  4 19:27:58 CDT 2013


How reproducible:
Everytime

Comment 1 RHEL Product and Program Management 2013-09-03 08:45:53 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Comment 3 Corey Marthaler 2014-01-16 21:11:04 UTC
Looks like this works in the latest rpms and can be added to the 7.0 errata.

3.10.0-54.0.1.el7.x86_64
lvm2-2.02.103-11.el7    BUILT: Wed Jan 15 06:44:23 CST 2014
lvm2-libs-2.02.103-11.el7    BUILT: Wed Jan 15 06:44:23 CST 2014
lvm2-cluster-2.02.103-11.el7    BUILT: Wed Jan 15 06:44:23 CST 2014
device-mapper-1.02.82-11.el7    BUILT: Wed Jan 15 06:44:23 CST 2014
device-mapper-libs-1.02.82-11.el7    BUILT: Wed Jan 15 06:44:23 CST 2014
device-mapper-event-1.02.82-11.el7    BUILT: Wed Jan 15 06:44:23 CST 2014
device-mapper-event-libs-1.02.82-11.el7    BUILT: Wed Jan 15 06:44:23 CST 2014
device-mapper-persistent-data-0.2.8-2.el7    BUILT: Wed Oct 30 10:20:48 CDT 2013
cmirror-2.02.103-11.el7    BUILT: Wed Jan 15 06:44:23 CST 2014


[root@harding-02 ~]# lvs -a -o +devices
  LV              VG              Attr       LSize  Pool Origin Devices
  POOL            snapper_thinp   twi---tz--  1.00g             POOL_tdata(0)
  [POOL_tdata]    snapper_thinp   Twi-------  1.00g             /dev/sdc3(1)
  [POOL_tmeta]    snapper_thinp   ewi-------  4.00m             /dev/sdb2(0)
  [lvol0_pmspare] snapper_thinp   ewi-------  4.00m             /dev/sdc3(0)
  newtmeta        snapper_thinp   -wi-------  8.00m             /dev/sdc3(257)
  origin          snapper_thinp   Vwi---tz--  1.00g POOL
  other1          snapper_thinp   Vwi---tz--  1.00g POOL
  other2          snapper_thinp   Vwi---tz--  1.00g POOL
  other3          snapper_thinp   Vwi---tz--  1.00g POOL
  other4          snapper_thinp   Vwi---tz--  1.00g POOL
  other5          snapper_thinp   Vwi---tz--  1.00g POOL
  snap            snapper_thinp   Vwi---tz-k  1.00g POOL origin
[root@harding-02 ~]# lvconvert --poolmetadata snapper_thinp/newtmeta --thinpool snapper_thinp/POOL
Do you want to swap metadata of snapper_thinp/POOL pool with volume snapper_thinp/newtmeta? [y/n]: y
  Converted snapper_thinp/POOL to thin pool.
[root@harding-02 ~]# lvs -a -o +devices
  LV              VG              Attr       LSize  Pool Origin Devices
  POOL            snapper_thinp   twi---tz--  1.00g             POOL_tdata(0)
  [POOL_tdata]    snapper_thinp   Twi-------  1.00g             /dev/sdc3(1)
  [POOL_tmeta]    snapper_thinp   ewi-------  8.00m             /dev/sdc3(257)
  [lvol0_pmspare] snapper_thinp   ewi-------  4.00m             /dev/sdc3(0)
  newtmeta        snapper_thinp   -wi-------  4.00m             /dev/sdb2(0)
  origin          snapper_thinp   Vwi---tz--  1.00g POOL
  other1          snapper_thinp   Vwi---tz--  1.00g POOL
  other2          snapper_thinp   Vwi---tz--  1.00g POOL
  other3          snapper_thinp   Vwi---tz--  1.00g POOL
  other4          snapper_thinp   Vwi---tz--  1.00g POOL
  other5          snapper_thinp   Vwi---tz--  1.00g POOL
  snap            snapper_thinp   Vwi---tz-k  1.00g POOL origin

Comment 5 Ludek Smid 2014-06-13 12:31:00 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.