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 1578145 - confusion over --splitmirrors when attempting additional non tracked split with existing tracked image
Summary: confusion over --splitmirrors when attempting additional non tracked split wi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.5
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: David Teigland
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-14 21:42 UTC by Corey Marthaler
Modified: 2021-09-03 12:41 UTC (History)
8 users (show)

Fixed In Version: lvm2-2.02.180-2.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 11:02:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3193 0 None None None 2018-10-30 11:03:20 UTC

Description Corey Marthaler 2018-05-14 21:42:26 UTC
Description of problem:

[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 ~]# lvs -a -o +devices
  LV                        VG            Attr       LSize   Cpy%Sync Devices
  split_tracking            split_image   rwi-a-r--- 500.00m 33.81    split_tracking_rimage_0(0),split_tracking_rimage_1(0),split_tracking_rimage_2(0),split_tracking_rimage_3(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   Iwi-aor--- 500.00m          /dev/sdc1(1)
  [split_tracking_rimage_3] split_image   Iwi-aor--- 500.00m          /dev/sdb1(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-aor---   4.00m          /dev/sdc1(0)
  [split_tracking_rmeta_3]  split_image   ewi-aor---   4.00m          /dev/sdb1(0)

# This makes sense
[root@host-093 ~]# lvconvert --yes --splitmirrors 1 --trackchanges split_image/split_tracking
  Unable to split image from split_image/split_tracking while not in-sync.

[root@host-093 ~]# lvs -a -o +devices
  LV                        VG            Attr       LSize   Cpy%Sync Devices
  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_3(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   iwi-aor--- 500.00m          /dev/sdc1(1)
  [split_tracking_rimage_3] split_image   iwi-aor--- 500.00m          /dev/sdb1(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-aor---   4.00m          /dev/sdc1(0)
  [split_tracking_rmeta_3]  split_image   ewi-aor---   4.00m          /dev/sdb1(0)

[root@host-093 ~]# lvconvert --yes --splitmirrors 1 --trackchanges split_image/split_tracking
  split_image/split_tracking_rimage_3 split from split_image/split_tracking for read-only purposes.
  Use 'lvconvert --merge split_image/split_tracking_rimage_3' to merge back into split_image/split_tracking.

[root@host-093 ~]# lvs -a -o +devices
  LV                        VG            Attr       LSize   Cpy%Sync Devices                                                                                                    
  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_3(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   iwi-aor--- 500.00m          /dev/sdc1(1)
  split_tracking_rimage_3   split_image   Iri-a-r--- 500.00m          /dev/sdb1(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-aor---   4.00m          /dev/sdc1(0)
  [split_tracking_rmeta_3]  split_image   ewi-a-r---   4.00m          /dev/sdb1(0)

# Makes sense, only one at a time 
[root@host-093 ~]# lvconvert --yes --splitmirrors 1 --trackchanges split_image/split_tracking
  Cannot track more than one split image at a time.

[root@host-093 ~]# lvconvert --yes --splitmirrors 1 --trackchanges split_image/split_tracking /dev/sda1
  Cannot track more than one split image at a time.

# 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.

# Again, makes sense the added --name shouldn't matter
[root@host-093 ~]# lvconvert --yes --splitmirrors 1 --name foo split_image/split_tracking /dev/sda1
  Unable to split additional image from split_image/split_tracking while tracking changes for split_image/split_tracking_rimage_3.

# Now, w/o a listed PV, adding the --name actually converts the existing merged image (with tracked changes) into a non tracked new volume. I couldn't find anywhere in the man page where this was the expected behavior. Now any merge possibility is gone.
[root@host-093 ~]# lvconvert --yes --splitmirrors 1 --name foo split_image/split_tracking

[root@host-093 ~]# lvs -a -o +devices
  LV                        VG            Attr       LSize   Cpy%Sync Devices
  foo                       split_image   -ri-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   iwi-aor--- 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-aor---   4.00m          /dev/sdc1(0)

# created another one w/o tracking
[root@host-093 ~]# lvconvert --yes --splitmirrors 1 --name foo2 split_image/split_tracking
[root@host-093 ~]# lvs -a -o +devices
  LV                        VG            Attr       LSize   Cpy%Sync Devices
  foo                       split_image   -ri-a----- 500.00m          /dev/sdb1(1)
  foo2                      split_image   -wi-a----- 500.00m          /dev/sdc1(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_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_rmeta_0]  split_image   ewi-aor---   4.00m          /dev/sde1(0)
  [split_tracking_rmeta_1]  split_image   ewi-aor---   4.00m          /dev/sda1(0)

# No longer able to merge back
[root@host-093 ~]# lvconvert --yes --mergemirrors split_image/foo2
  split_image/foo2 is not read-only - refusing to merge.

[root@host-093 ~]# lvconvert --yes --mergemirrors split_image/foo
  Unable to merge non-mirror image split_image/foo.




Version-Release number of selected component (if applicable):
3.10.0-862.el7.x86_64

lvm2-2.02.177-4.el7    BUILT: Fri Feb 16 06:22:31 CST 2018
lvm2-libs-2.02.177-4.el7    BUILT: Fri Feb 16 06:22:31 CST 2018
lvm2-cluster-2.02.177-4.el7    BUILT: Fri Feb 16 06:22:31 CST 2018
device-mapper-1.02.146-4.el7    BUILT: Fri Feb 16 06:22:31 CST 2018
device-mapper-libs-1.02.146-4.el7    BUILT: Fri Feb 16 06:22:31 CST 2018
device-mapper-event-1.02.146-4.el7    BUILT: Fri Feb 16 06:22:31 CST 2018
device-mapper-event-libs-1.02.146-4.el7    BUILT: Fri Feb 16 06:22:31 CST 2018
device-mapper-persistent-data-0.7.3-3.el7    BUILT: Tue Nov 14 05:07:18 CST 2017
cmirror-2.02.177-4.el7    BUILT: Fri Feb 16 06:22:31 CST 2018

Comment 2 Corey Marthaler 2018-05-14 21:51:28 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.

Comment 3 David Teigland 2018-07-23 16:15:35 UTC
> # 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.

Comment 4 Jonathan Earl Brassow 2018-07-23 16:39:14 UTC
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

Comment 7 Roman Bednář 2018-08-08 12:45:15 UTC
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

Comment 9 errata-xmlrpc 2018-10-30 11:02:26 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.

https://access.redhat.com/errata/RHBA-2018:3193


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