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 743640 - RFE: LVM - Extending mirrors should allow '--nosync' option.
Summary: RFE: LVM - Extending mirrors should allow '--nosync' option.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 756082
TreeView+ depends on / blocked
 
Reported: 2011-10-05 15:35 UTC by Jonathan Earl Brassow
Modified: 2013-05-15 09:31 UTC (History)
11 users (show)

Fixed In Version: lvm2-2.02.95-1.el6
Doc Type: Enhancement
Doc Text:
It is now possible to extend a mirrored logical volume without inducing a synchronization of the new portion. The '--nosync' option to lvextend will skip the initial synchronization. This can save time and is acceptable if the user does not intend to read what they haven't written - a common situation.
Clone Of:
Environment:
Last Closed: 2012-06-20 15:00:12 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 Jonathan Earl Brassow 2011-10-05 15:35:32 UTC
A mirror can be created with a '--nosync' option that allows the mirror to skip the initial resync.  lvresize/lvextend should be allowed to skip the initial resync when adding extra space to a mirror also.

Comment 2 Jonathan Earl Brassow 2011-10-05 16:17:47 UTC
Release criteria (test requirements):

1) A mirror created with '--nosync' should extend with 'nosync' implicitly
[EXAMPLE]# lvs vg; lvextend -L +5G vg/lv ; lvs vg
  LV   VG   Attr     LSize Pool Origin Snap%  Move Log     Copy%  Convert
  lv   vg   Mwi-a-m- 5.00g                         lv_mlog 100.00        
  Extending 2 mirror images.
  Extending logical volume lv to 10.00 GiB
  Logical volume lv successfully resized
  LV   VG   Attr     LSize  Pool Origin Snap%  Move Log     Copy%  Convert
  lv   vg   Mwi-a-m- 10.00g                         lv_mlog 100.00        

2) The 'M' attribute ('M' signifies a mirror created with '--nosync', while 'm' signifies a mirror created w/o '--nosync') must be preserved when extending a mirror created with '--nosync'.  See #1 for example of 'M' attribute.

3) A mirror created without '--nosync' should extend with 'nosync' only when '--nosync' is explicitly used when extending.
[EXAMPLE]# lvs vg; lvextend -L +5G vg/lv; lvs vg
  LV   VG   Attr     LSize  Pool Origin Snap%  Move Log     Copy%  Convert
  lv   vg   mwi-a-m- 20.00m                         lv_mlog 100.00        
  Extending 2 mirror images.
  Extending logical volume lv to 5.02 GiB
  Logical volume lv successfully resized
  LV   VG   Attr     LSize Pool Origin Snap%  Move Log     Copy%  Convert
  lv   vg   mwi-a-m- 5.02g                         lv_mlog   0.39        
vs.
[EXAMPLE]# lvs vg; lvextend -L +5G vg/lv --nosync; lvs vg
  LV   VG   Attr     LSize  Pool Origin Snap%  Move Log     Copy%  Convert
  lv   vg   mwi-a-m- 20.00m                         lv_mlog 100.00        
  Extending 2 mirror images.
  Extending logical volume lv to 5.02 GiB
  Logical volume lv successfully resized
  LV   VG   Attr     LSize Pool Origin Snap%  Move Log     Copy%  Convert
  lv   vg   Mwi-a-m- 5.02g                         lv_mlog 100.00        

4) The 'm' attribute must change to 'M' when extending a mirror created without '--nosync' is extended with the '--nosync' option.  (See #3 examples above.)

5) An inactive mirror's sync percent cannot be determined definitively, so it must not be allowed to skip resync.  Instead, the extend should ask the user if they want to extend while performing a resync.
[EXAMPLE]# lvchange -an vg/lv
[EXAMPLE]# lvextend -L +5G vg/lv
  Extending 2 mirror images.
  Extending logical volume lv to 10.00 GiB
  vg/lv is not active.  Unable to get sync percent.
Do full resync of extended portion of vg/lv?  [y/n]: y
  Logical volume lv successfully resized

6) A mirror that is performing recovery (as opposed to an initial sync) - like after a failure - is not allowed to extend with a either an implicit or explicit nosync option.  [You can simulate this with a 'corelog' mirror because when it is reactivated, it must be recovered every time.]
[EXAMPLE]# lvcreate -m1 -L 5G -n lv vg --nosync --corelog
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Logical volume "lv" created
[EXAMPLE]# lvs vg
  LV   VG   Attr     LSize Pool Origin Snap%  Move Log Copy%  Convert
  lv   vg   Mwi-a-m- 5.00g                             100.00        
[EXAMPLE]# lvchange -an vg/lv; lvchange -ay vg/lv; lvs vg
  LV   VG   Attr     LSize Pool Origin Snap%  Move Log Copy%  Convert
  lv   vg   Mwi-a-m- 5.00g                               0.08        
[EXAMPLE]# lvextend -L +5G vg/lv
  Extending 2 mirror images.
  Extending logical volume lv to 10.00 GiB
  vg/lv cannot be extended while it is recovering.

7) If 'no' is selected in #5 or if the condition in #6 is hit, it should not result in the mirror being resized or the 'm/M' attribute being changed.


NOTE: A mirror created with '--nosync' behaves differently than one created without it when performing an extension.  The former cannot be extended when the mirror is recovering (unless in-active), while the latter can.

Comment 3 Corey Marthaler 2011-10-06 15:23:20 UTC
Adding QA ack for 6.3.

Comment 4 Jonathan Earl Brassow 2011-10-06 15:50:34 UTC
Checked-in upstream in version 2.02.89.
Git commit id:  76ab2642004d56add4f0ddd2924f0e2baefde1a6

Comment 6 Corey Marthaler 2012-04-03 20:29:58 UTC
Feature verified in the latest rpms with both single machine and cluster mirrors.

2.6.32-251.el6.x86_64
lvm2-2.02.95-3.el6    BUILT: Fri Mar 30 09:54:10 CDT 2012
lvm2-libs-2.02.95-3.el6    BUILT: Fri Mar 30 09:54:10 CDT 2012
lvm2-cluster-2.02.95-3.el6    BUILT: Fri Mar 30 09:54:10 CDT 2012
udev-147-2.40.el6    BUILT: Fri Sep 23 07:51:13 CDT 2011
device-mapper-1.02.74-3.el6    BUILT: Fri Mar 30 09:54:10 CDT 2012
device-mapper-libs-1.02.74-3.el6    BUILT: Fri Mar 30 09:54:10 CDT 2012
device-mapper-event-1.02.74-3.el6    BUILT: Fri Mar 30 09:54:10 CDT 2012
device-mapper-event-libs-1.02.74-3.el6    BUILT: Fri Mar 30 09:54:10 CDT 2012
cmirror-2.02.95-3.el6    BUILT: Fri Mar 30 09:54:10 CDT 2012



SCENARIO - [resync_mirror_extend_attempt]
Create a nosync mirror, reactivate it to cause a resync, then attempt to extend it
taft-01: lvcreate -m 1 -n resync_mirror_extend -L 1G --corelog --nosync mirror_sanity
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
Deactivate and then reactivate the mirror
Attempt to extend the mirror while it's resyncing
  mirror_sanity/resync_mirror_extend cannot be extended while it is recovering.
Deactivating mirror resync_mirror_extend... and removing


SCENARIO - [nosync_mirror_extensions]
Case 1: Create a nosync mirror then verify an extension preserves the --nosync (M) attribute
taft-01: lvcreate -m 1 -n nosync_mirror_extend -L 200M --corelog --nosync mirror_sanity
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
Extend the mirror and verify that the nosync attr is preserved
Deactivating mirror nosync_mirror_extend... and removing

Case 2: Create a synced mirror then extend it using the --nosync (M) attribute
taft-01: lvcreate -m 1 -n sync_mirror_nosync_extend -L 200M --corelog mirror_sanity
Waiting until all mirror|raid volumes become fully syncd...
   1/1 mirror(s) are fully synced: ( 100.00% )

Extend the mirror and verify that the nosync attr is preserved
Deactivating mirror sync_mirror_nosync_extend... and removing


SCENARIO - [inactive_nosync_mirror_extensions]
Case 1: Create a nosynced mirror, deactivate it, then extend it with a full resync
taft-01: lvcreate -m 1 -n inactive_nosync_extend -L 500M --corelog --nosync mirror_sanity
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
Deactivate the mirror
Extend the mirror with a full resync
taft-01: echo y | lvextend -L +200M mirror_sanity/inactive_nosync_extend
Do full resync of extended portion of mirror_sanity/inactive_nosync_extend?  [y/n]: Activate the mirror
Waiting until all mirror|raid volumes become fully syncd...
   0/1 mirror(s) are fully synced: ( 31.57% )
   0/1 mirror(s) are fully synced: ( 51.64% )
   0/1 mirror(s) are fully synced: ( 80.64% )
   1/1 mirror(s) are fully synced: ( 100.00% )

Case 2: Deactivate this nosync mirror again, and again attempt to extend but without a full resync
Deactivate the mirror
Attempt to extend the mirror without a full resync
taft-01: echo n | lvextend -L +200M mirror_sanity/inactive_nosync_extend
Do full resync of extended portion of mirror_sanity/inactive_nosync_extend?  [y/n]:   Command failed with status code 5.
Deactivating mirror inactive_nosync_extend... and removing

Comment 7 Jonathan Earl Brassow 2012-04-23 18:26:54 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:
It is now possible to extend a mirrored logical volume without inducing a synchronization of the new portion.  The '--nosync' option to lvextend will skip the initial synchronization.  This can save time and is acceptable if the user does not intend to read what they haven't written - a common situation.

Comment 9 errata-xmlrpc 2012-06-20 15:00:12 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

Comment 10 Joe Pruett 2013-05-14 04:15:14 UTC
it doesn't look like the man page got updated. should a new bug be opened?

Comment 11 Peter Rajnoha 2013-05-14 07:42:42 UTC
(In reply to comment #10)
> it doesn't look like the man page got updated. should a new bug be opened?

The --nosync is documented under the "-m, --mirrors" option in the lvcreate man page:

SYNOPSIS
       lvcreate ... [-m|--mirrors Mirrors [--nosync] ...

OPTIONS
       -m, --mirrors Mirrors
...
 "Specifying  the  optional  argument --nosync will cause the creation of the mirror to skip the initial resynchronization.  Any data written afterwards will be mirrored, but the original contents will not be copied.  This is useful for skipping a potentially long and resource intensive initial sync of an empty device."
...

Comment 12 Joe Pruett 2013-05-14 13:51:45 UTC
the initial issue of this bug was to add --nosync to lvextend, and that man page doesn't have the option documented. after i looked at the man page, i searched for lvextend nosync and found this bug which then led me to try it. i have also since discovered that lvextend --help does list the option. but still, the lvextend man page should be updated.

does it also make sense to have lvresize support the --nosync option since it can also do what lvextend does?

Comment 13 Peter Rajnoha 2013-05-15 09:31:20 UTC
(In reply to comment #12)
> the initial issue of this bug was to add --nosync to lvextend, and that man
> page doesn't have the option documented. after i looked at the man page, i
> searched for lvextend nosync and found this bug which then led me to try it.
> i have also since discovered that lvextend --help does list the option. but
> still, the lvextend man page should be updated.
> 
> does it also make sense to have lvresize support the --nosync option since
> it can also do what lvextend does?

Ah, yes, indeed, the lvextend + lvresize man page needs updating. Sorry for confusion. I've opened a new 6.5 bug #963154 to review all the options vs. man page entries. Thanks for the report.


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