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 857060 - lvchange --resync not working correctly on mirrored LVs
Summary: lvchange --resync not working correctly on mirrored LVs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.4
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-13 13:33 UTC by Marian Csontos
Modified: 2013-02-21 08:13 UTC (History)
11 users (show)

Fixed In Version: lvm2-2.02.98-1.el6
Doc Type: Bug Fix
Doc Text:
No doc needed - intra-release bug.
Clone Of:
Environment:
Last Closed: 2013-02-21 08:13:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0501 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2013-02-20 21:30:45 UTC

Description Marian Csontos 2012-09-13 13:33:25 UTC
Description of problem:
`lvchange --resync` does not resync the mirrored LVs

Version-Release number of selected component (if applicable):
RHEL6.3 GA
- kernel-2.6.32-279.el6.x86_64
- lvm2-2.02.98-0.176.el6.x86_64
  - upstream lvm2 git version 4ededc698f3. Issue introduced after b49b98d50c558.

How reproducible:
100%

Steps to Reproduce:

    VG=vg_temp
    LV=lv_test
    lvcreate -m 1 -n $LV -L 20M --corelog --nosync $VG || exit 1
    lvs -av $VG
    lvconvert -m 2 --corelog $VG/$LV && echo "ERROR: Unexpected pass" >&2
    lvchange -an $VG/$LV || exit $?
    lvchange --resync $VG/$LV || exit $?
    lvchange -ay $VG/$LV || exit $?
    lvs -av $VG
    lvconvert -m 2 --corelog $VG/$LV || echo "ERROR[$?]: The bug is here!"
    lvs -av $VG

Running `watch "lvs -av vg_temp 2>/dev/null"` in other window there is no activity.
  
Actual results:
lvconvert exits with 5 saying:

  Can't add mirror to out-of-sync mirrored LV: use lvchange --resync first.

Expected results:
pass

Additional info:

Comment 3 Jonathan Earl Brassow 2012-09-19 15:06:07 UTC
Unit test (before):
[root@hayes-01 lvm2]# lvcreate --corelog -m 1 --nosync -L 500M -n lv vg
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "lv" created

[root@hayes-01 lvm2]# lvconvert -m +1 vg/lv
  Can't add mirror to out-of-sync mirrored LV: use lvchange --resync first.

[root@hayes-01 lvm2]# lvchange --resync vg/lv
Do you really want to deactivate logical volume lv to resync it? [y/n]: y

[root@hayes-01 lvm2]# lvconvert -m +1 vg/lv
  Can't add mirror to out-of-sync mirrored LV: use lvchange --resync first.

Unit test (after):
[root@hayes-01 lvm2]# lvcreate --corelog -m 1 --nosync -L 500M -n lv vg
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "lv" created

[root@hayes-01 lvm2]# lvconvert -m +1 vg/lv
  Can't add mirror to out-of-sync mirrored LV: use lvchange --resync first.

[root@hayes-01 lvm2]# lvchange --resync vg/lv
Do you really want to deactivate logical volume lv to resync it? [y/n]: y

[root@hayes-01 lvm2]# lvconvert -m +1 vg/lv
  vg/lv: Converted: 1.6%
  vg/lv: Converted: 76.8%
  vg/lv: Converted: 100.0%


Will commit fix after test suite run...

Comment 4 Jonathan Earl Brassow 2012-09-19 16:19:34 UTC
commit 2e04681248b7c72ce295f538d698ae644c73cc9c
Author: Jonathan Brassow <jbrassow>
Date:   Wed Sep 19 11:09:32 2012 -0500

    mirror:  'lvconvert --resync' should reset LV_NOTSYNCED on corelog mirror
    
    When reformatting the 'lvchange_resync' code in commit
    05131f5853e86419d9c726faa961b8d012298d9c, a '!' should have been removed
    from the condition that checks for the LV_NOTSYNCED flag on a corelog
    mirror LV.  The presence of this '!' caused the LV_NOTSYNCED flag to be
    cleared when it wasn't present and left when it was present.
    
    It is not allowed to add images to a 'mirror' or 'raid1' LV if the
    LV_NOTSYNCED flag is set.  We add some up-convert tests to ensure this
    behavior is being enforced and that the LV_NOTSYNCED flag is being
    properly cleared by 'lvchange --resync'.
    
    (Not updating WHATS_NEW because this is intrarelease.)

Comment 6 Nenad Peric 2012-11-01 10:58:41 UTC
Marking verified, tested with lvm2-2.02.98-2.el6.x86_64

Comment 7 errata-xmlrpc 2013-02-21 08:13:41 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-2013-0501.html


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