Bug 743640
| Summary: | RFE: LVM - Extending mirrors should allow '--nosync' option. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Jonathan Earl Brassow <jbrassow> |
| Component: | lvm2 | Assignee: | Jonathan Earl Brassow <jbrassow> |
| Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.2 | CC: | agk, cmarthal, dwysocha, heinzm, jbrassow, joey, mbroz, prajnoha, prockai, thornber, zkabelac |
| Target Milestone: | rc | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| 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.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-06-20 15:00:12 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 756082 | ||
|
Description
Jonathan Earl Brassow
2011-10-05 15:35:32 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.
Adding QA ack for 6.3. Checked-in upstream in version 2.02.89. Git commit id: 76ab2642004d56add4f0ddd2924f0e2baefde1a6 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
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.
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 it doesn't look like the man page got updated. should a new bug be opened? (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." ... 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? (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. |