RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 816672 - Partial activation (missing segment replacement) is broken
Summary: Partial activation (missing segment replacement) is broken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Zdenek Kabelac
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 822136
TreeView+ depends on / blocked
 
Reported: 2012-04-26 16:25 UTC by Milan Broz
Modified: 2013-03-01 04:11 UTC (History)
13 users (show)

Fixed In Version: lvm2-2.02.95-9.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Clone Of:
: 822136 (view as bug list)
Environment:
Last Closed: 2012-06-20 15:03:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0962 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2012-06-19 21:12:11 UTC

Description Milan Broz 2012-04-26 16:25:49 UTC
Description of problem:

Seems that --partial activation is now impossible if LV segments are missing.

# vgcreate vgt /dev/sdb[12]
  Volume group "vgt" successfully created
# lvcreate -n lv -l100%FREE vgt
  Logical volume "lv" created
# vgchange -a n vgt

destroy one PV:
# dd if=/dev/zero of=/dev/sdb1 bs=1M count=1
# vgscan
  Reading all physical volumes.  This may take a while...
  Couldn't find device with uuid E3uAeM-Mzkn-Jcig-mzD5-3ZPd-33sL-R7RkSX.
  ...
# lvs -o +devices vgt
  Couldn't find device with uuid E3uAeM-Mzkn-Jcig-mzD5-3ZPd-33sL-R7RkSX.
  LV   VG   Attr   LSize  Origin Snap%  Move Log Copy%  Convert Devices          
  lv   vgt  -wi-a- 15.33g                                       unknown device(0)
  lv   vgt  -wi-a- 15.33g                                       /dev/sdb2(0)     

Now, if we partially activate it, missing segment is replaced
with missing_stripe_filler (see lvm.conf), default is error:
# vgchange -a y vgt --partial
  Partial mode. Incomplete logical volumes will be processed.
  Couldn't find device with uuid E3uAeM-Mzkn-Jcig-mzD5-3ZPd-33sL-R7RkSX.
  1 logical volume(s) in volume group "vgt" now active

# dmsetup table |grep vgt
vgt-lv: 0 16072704 linear 253:3 0
vgt-lv: 16072704 16072704 linear 8:18 2048
vgt-lv-missing_0_0: 0 16072704 error 

lvm2-2.02.87-6.el6


For 6.3 lvm2 (here using some test version) it is broken:
lvm2-2.02.96-0.104.el6

# vgchange -a y vgt --partial
  Partial mode. Incomplete logical volumes will be processed.
  Couldn't find device with uuid E3uAeM-Mzkn-Jcig-mzD5-3ZPd-33sL-R7RkSX.
  Cannot activate vgt/lv: all segments missing.
  0 logical volume(s) in volume group "vgt" now active
# dmsetup table |grep vgt
[nothing]

There should be also some basic test coverage for this.

Comment 1 Corey Marthaler 2012-04-26 16:37:59 UTC
We'll add test cases for this to the regression suite.

Comment 2 Alasdair Kergon 2012-04-26 16:57:07 UTC
add_areas_line() is trying to detect if a partial activation is pointless, but is only looking at one segment in isolation.

1) The test needs to consider the LV as a whole - check all segments at once, not each individually.

2) If all areas used by a segment are missing, the whole segment should be mapped to an error target.

Comment 3 Milan Broz 2012-05-09 15:00:03 UTC
From call: if it is easier to revert patch to reintroduce previous state, let's do it for 6.3.

And fix it properly upstream.

Peter, I think it was your patch causing this problem, can you take a look? THX.

Comment 4 Alasdair Kergon 2012-05-16 11:38:47 UTC
Should be split into two.

(a) revert this from upstream/RHEL6.3:

               if (!num_existing_areas &&
                   !strstr(seg->lv->name, "_mimage_") &&
                   !((name = strstr(seg->lv->name, "_mlog")) && !name[5])) {
                       log_error("Cannot activate %s/%s: all segments missing."
                                 seg->lv->vg->name, seg->lv->name);
                       return 0;

(b) new bug for upstream/RHEL6.4 to deal with the issue properly (comment #2)

Comment 8 Corey Marthaler 2012-05-17 20:27:57 UTC
Fix verified in the latest rpms.

2.6.32-270.el6.x86_64
lvm2-2.02.95-9.el6    BUILT: Wed May 16 10:34:14 CDT 2012
lvm2-libs-2.02.95-9.el6    BUILT: Wed May 16 10:34:14 CDT 2012
lvm2-cluster-2.02.95-9.el6    BUILT: Wed May 16 10:34:14 CDT 2012
udev-147-2.41.el6    BUILT: Thu Mar  1 13:01:08 CST 2012
device-mapper-1.02.74-9.el6    BUILT: Wed May 16 10:34:14 CDT 2012
device-mapper-libs-1.02.74-9.el6    BUILT: Wed May 16 10:34:14 CDT 2012
device-mapper-event-1.02.74-9.el6    BUILT: Wed May 16 10:34:14 CDT 2012
device-mapper-event-libs-1.02.74-9.el6    BUILT: Wed May 16 10:34:14 CDT 2012
cmirror-2.02.95-9.el6    BUILT: Wed May 16 10:34:14 CDT 2012

[root@taft-01 ~]# vgcreate test /dev/sd[bc][1]
  Volume group "test" successfully created

[root@taft-01 ~]# lvcreate -n lv -l100%FREE  test
  Logical volume "lv" created

[root@taft-01 ~]# lvs -a -o +devices
  LV  VG    Attr     LSize    Devices         
  lv  test  -wi-a--- 271.33g  /dev/sdb1(0)    
  lv  test  -wi-a--- 271.33g  /dev/sdc1(0)    

[root@taft-01 ~]# vgchange -a n test
  0 logical volume(s) in volume group "test" now active

[root@taft-01 ~]# dd if=/dev/zero of=/dev/sdb1 bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0115695 s, 90.6 MB/s

[root@taft-01 ~]# vgscan
  Reading all physical volumes.  This may take a while...
  Couldn't find device with uuid egskWs-Zx5i-DQwE-x1B4-tamM-jeOh-wfphE5.
  Found volume group "test" using metadata type lvm2
  Found volume group "vg_taft01" using metadata type lvm2

[root@taft-01 ~]# lvs -o +devices test
  Couldn't find device with uuid egskWs-Zx5i-DQwE-x1B4-tamM-jeOh-wfphE5.
  LV   VG   Attr     LSize   Devices          
  lv   test -wi----- 271.33g unknown device(0)
  lv   test -wi----- 271.33g /dev/sdc1(0)     

[root@taft-01 ~]# vgchange -a y test --partial
  Partial mode. Incomplete logical volumes will be processed.
  Couldn't find device with uuid egskWs-Zx5i-DQwE-x1B4-tamM-jeOh-wfphE5.
  1 logical volume(s) in volume group "test" now active

[root@taft-01 ~]# dmsetup table |grep test
test-lv: 0 284508160 linear 253:3 0
test-lv: 284508160 284508160 linear 8:33 2048
test-lv-missing_0_0: 0 284508160 error

Comment 9 Peter Rajnoha 2012-05-22 09:29:59 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.

Comment 11 errata-xmlrpc 2012-06-20 15:03:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0962.html


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