Bug 213759 - regression: mirror sync log not being properly zero'ed out
regression: mirror sync log not being properly zero'ed out
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: lvm2 (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-02 16:18 EST by Corey Marthaler
Modified: 2007-11-16 20:14 EST (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2007-0287
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-07 20:12:27 EDT
Type: ---
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 Corey Marthaler 2006-11-02 16:18:57 EST
Description of problem:
When creating a mirror the whole mirror should need to be sync'ed, but it
appears that that isn't what is happening with the current code. The mirror
instantly jumps to 70% or 80% sync'ed and then continues slowly to sync the rest
of the mirror properly. 

[root@link-08 ~]# lvcreate -m 1 -n mirror -L 50G vg
  Logical volume "mirror" created
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log         Copy%
  mirror vg   mwi-a- 50.00G                    mirror_mlog  76.14
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log         Copy%
  mirror vg   mwi-a- 50.00G                    mirror_mlog  76.25
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log         Copy%
  mirror vg   mwi-a- 50.00G                    mirror_mlog  76.27

If you use a corelog, then it appears to work correctly.

[root@link-08 ~]# lvcreate --corelog -m 1 -n mirror -L 50G vg
  Logical volume "mirror" created
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log Copy%
  mirror vg   mwi-a- 50.00G                          0.05
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log Copy%
  mirror vg   mwi-a- 50.00G                          0.09
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log Copy%
  mirror vg   mwi-a- 50.00G                          0.11
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log Copy%
  mirror vg   mwi-a- 50.00G                          0.13


Version-Release number of selected component (if applicable):
[root@link-08 ~]# rpm -qa | grep lvm2
lvm2-cluster-2.02.13-1
lvm2-cluster-debuginfo-2.02.06-7.0.RHEL4
lvm2-2.02.13-1
[root@link-08 ~]# rpm -q device-mapper
device-mapper-1.02.12-3
[root@link-08 ~]# uname -ar
Linux link-08 2.6.9-42.17.ELsmp #1 SMP Mon Oct 9 18:42:57 EDT 2006 x86_64 x86_64
x86_64 GNU/Linux


How reproducible:
everytime
Comment 1 Corey Marthaler 2006-11-02 16:23:24 EST
If I run 'lvchange --resync <mirror>' that will cause the mirror to start
sync'ing from 0.0% like it's supposed to without the quick jump.
Comment 2 Corey Marthaler 2006-11-02 16:33:52 EST
Also, it always appears to start at the same percent for a given mirror size:

[root@link-08 ~]# lvcreate -m 1 -n mirror -L 75G vg
  Logical volume "mirror" created
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log         Copy%
  mirror vg   mwi-a- 75.00G                    mirror_mlog  84.04
[root@link-08 ~]# lvremove -f vg
  Logical volume "mirror" successfully removed
[root@link-08 ~]# lvcreate -m 1 -n mirror -L 75G vg
  Logical volume "mirror" created
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log         Copy%
  mirror vg   mwi-a- 75.00G                    mirror_mlog  84.04
[root@link-08 ~]# lvremove -f vg
  Logical volume "mirror" successfully removed
[root@link-08 ~]# lvcreate -m 1 -n mirror -L 75G vg
  Logical volume "mirror" created
[root@link-08 ~]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log         Copy%
  mirror vg   mwi-a- 75.00G                    mirror_mlog  84.05
Comment 3 Jonathan Earl Brassow 2006-11-02 16:37:43 EST
Comment #2 means that the same patern is being written to disk every time rather
than the device not actually being cleared.
Comment 4 RHEL Product and Program Management 2006-11-02 16:47:05 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux release.  Product Management has requested further review
of this request by Red Hat Engineering.  This request is not yet committed for
inclusion in release.
Comment 5 Jonathan Earl Brassow 2006-11-02 17:05:21 EST
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?r1=1.52&r2=1.53&cvsroot=lvm2&f=h

There's one problem... we shouldn't use with a 2nd arg of 1... it should be -1.
Comment 6 Jonathan Earl Brassow 2006-11-02 17:06:47 EST
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?r1=1.82&r2=1.83&cvsroot=lvm2&f=h

And there's the other problem...

dev_set(dev, UINT64_C(0), (size_t) 4096, value); will not clear out the whole
device, just the first 4096 bytes of it (based on what dev_set does).
Comment 7 Alasdair Kergon 2006-11-02 18:58:54 EST
untested patches applied upstream for those two problems
Comment 9 Alasdair Kergon 2006-11-10 17:19:58 EST
lvm2-2.02.14-1 built
Comment 10 Corey Marthaler 2006-11-13 19:08:32 EST
fix verified in lvm2-2.02.14-1.
Comment 13 Corey Marthaler 2007-02-16 17:40:35 EST
marking this verified again.
Comment 15 Red Hat Bugzilla 2007-05-07 20:12:27 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0287.html

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