Bug 1578145
| Summary: | confusion over --splitmirrors when attempting additional non tracked split with existing tracked image | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | lvm2 | Assignee: | David Teigland <teigland> |
| lvm2 sub component: | Mirroring and RAID | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | low | ||
| Priority: | unspecified | CC: | agk, heinzm, jbrassow, msnitzer, prajnoha, rbednar, teigland, zkabelac |
| Version: | 7.5 | ||
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.180-2.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-10-30 11:02:26 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Corey Marthaler
2018-05-14 21:42:26 UTC
# I recreated this mirror and tried the mixed tracked and non tracked split in the other order: [root@host-093 ~]# lvcreate --activate y --type raid1 -m 3 -n split_tracking -L 500M split_image Logical volume "split_tracking" created. [root@host-093 ~]# lvconvert --yes --splitmirrors 1 --name foo split_image/split_tracking [root@host-093 ~]# lvconvert --yes --splitmirrors 1 --trackchanges split_image/split_tracking split_image/split_tracking_rimage_2 split from split_image/split_tracking for read-only purposes. Use 'lvconvert --merge split_image/split_tracking_rimage_2' to merge back into split_image/split_tracking. [root@host-093 ~]# lvs -a -o +devices LV VG Attr LSize Cpy%Sync Devices foo split_image -wi-a----- 500.00m /dev/sdb1(1) split_tracking split_image rwi-a-r--- 500.00m 100.00 split_tracking_rimage_0(0),split_tracking_rimage_1(0),split_tracking_rimage_2(0) [split_tracking_rimage_0] split_image iwi-aor--- 500.00m /dev/sde1(1) [split_tracking_rimage_1] split_image iwi-aor--- 500.00m /dev/sda1(1) split_tracking_rimage_2 split_image Iri-a-r--- 500.00m /dev/sdc1(1) [split_tracking_rmeta_0] split_image ewi-aor--- 4.00m /dev/sde1(0) [split_tracking_rmeta_1] split_image ewi-aor--- 4.00m /dev/sda1(0) [split_tracking_rmeta_2] split_image ewi-a-r--- 4.00m /dev/sdc1(0) # Still allowed to merge since the tracked changes was the last split [root@host-093 ~]# lvconvert --yes --mergemirrors split_image/split_tracking_rimage_2 split_image/split_tracking_rimage_2 successfully merged back into split_image/split_tracking. # This error however is really a red herring since it's not the write permission that matters, it's that it wasn't split w/ --trackchanges [root@host-093 ~]# lvconvert --yes --mergemirrors split_image/foo split_image/foo is not read-only - refusing to merge. [root@host-093 ~]# lvchange -pr split_image/foo Logical volume split_image/foo changed. [root@host-093 ~]# lvconvert --yes --mergemirrors split_image/foo Unable to merge non-mirror image split_image/foo. > # This could probably be its own bug, this cmd *does* accept that option, just > happens to be missing a "--trackchanges" or "--name" along with it > [root@host-093 ~]# lvconvert --yes --splitmirrors 1 split_image/split_tracking > Command does not accept option: --splitmirrors 1. Fixed here for rhel8 https://sourceware.org/git/?p=lvm2.git;a=commit;h=8a66c81b9beb87f2f381e7e2aa76e4e54fd19934 # lvconvert --splitmirrors 1 test/new No command with matching syntax recognised. Run 'lvconvert --help' for more information. Nearest similar command has syntax: lvconvert --splitmirrors Number -n|--name LV_new LV_cache_mirror_raid1 Split images from a raid1 or mirror LV and use them to create a new LV. We need a number of clean-ups here: 1) This cmd *does* accept that option, just happens to be missing a "--trackchanges" or "--name" along with it [root@host-093 ~]# lvconvert --yes --splitmirrors 1 split_image/split_tracking Command does not accept option: --splitmirrors 1. 2) s/non-mirror/non-RAID1/ [root@host-093 ~]# lvconvert --yes --mergemirrors split_image/foo Unable to merge non-mirror image split_image/foo. 3) From comment 2: # This error however is really a red herring since it's not the write permission that matters, it's that it wasn't split w/ --trackchanges [root@host-093 ~]# lvconvert --yes --mergemirrors split_image/foo split_image/foo is not read-only - refusing to merge. 4) lvconvert man page update: Description for '--trackchanges' should say that the "track cahnges" state should be considered a temporary one. Only two operations are allowed when the RAID1 LV is in this state - merge the image back into the RAID1 LV or permanently split the image from the RAID1 LV. (It would be good to illustrate the commands necessary to perform this action.) PERMANENT SPLIT: [root@bp-01 ~]# lvconvert --splitmirrors 1 --trackchanges vg/lv /dev/sdb1 vg/lv_rimage_0 split from vg/lv for read-only purposes. Use 'lvconvert --merge vg/lv_rimage_0' to merge back into vg/lv. [root@bp-01 ~]# lvconvert --splitmirrors 1 --name lv3 vg/lv MERGE BACK: [root@host-093 ~]# lvconvert --merge vg/lv_rimage_2 rhel8 commits for messages and man page https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=778ce8d80830a60d258b419720be3e45a7ee9f0b 7.6 commits: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9e296c9c6f3fa92fdc839b30012b51ee28d23d1a https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b394a9f63fd01c926c8c00d78f43afb223b2d203 Verified.
1) improve message when --name or --trackchanges is ommited
# lvconvert --yes --splitmirrors 1 split_image/split_tracking
No command with matching syntax recognised. Run 'lvconvert --help' for more information.
Nearest similar command has syntax:
lvconvert --splitmirrors Number -n|--name LV_new LV_cache_mirror_raid1
Split images from a raid1 or mirror LV and use them to create a new LV.
2) changed error message to better indicate raid usage
# lvconvert --yes --mergemirrors split_image/foo
Unable to merge non-raid image split_image/foo.
3) Attempting merge without --trackchanges split message is now accurate
# lvconvert --yes --splitmirrors 1 --name foo split_image/split_tracking
# lvconvert --yes --mergemirrors split_image/foo
split_image/foo cannot be merged because --trackchanges was not used.
4) manpage changes
--trackchanges
Can be used with --splitmirrors on a raid1 LV. This causes changes to the original raid1 LV to be tracked while the split images remain detached. This is a temporary state that allows the
read-only detached image to be merged efficiently back into the raid1 LV later. Only the regions with changed data are resynchronized during merge. While a raid1 LV is tracking changes,
operations on it are limited to merging the split image (see --mergemirrors) or permanently splitting the image (see --splitmirrors with --name.
3.10.0-931.el7.x86_64
lvm2-2.02.180-2.el7
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. https://access.redhat.com/errata/RHBA-2018:3193 |