Bug 857060 - lvchange --resync not working correctly on mirrored LVs
lvchange --resync not working correctly on mirrored LVs
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.4
Unspecified Unspecified
high Severity medium
: rc
: ---
Assigned To: Jonathan Earl Brassow
Cluster QE
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-13 09:33 EDT by Marian Csontos
Modified: 2013-02-21 03:13 EST (History)
11 users (show)

See Also:
Fixed In Version: lvm2-2.02.98-1.el6
Doc Type: Bug Fix
Doc Text:
No doc needed - intra-release bug.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:13:41 EST
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 Marian Csontos 2012-09-13 09:33:25 EDT
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 11:06:07 EDT
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 12:19:34 EDT
commit 2e04681248b7c72ce295f538d698ae644c73cc9c
Author: Jonathan Brassow <jbrassow@redhat.com>
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 06:58:41 EDT
Marking verified, tested with lvm2-2.02.98-2.el6.x86_64
Comment 7 errata-xmlrpc 2013-02-21 03:13:41 EST
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.