Bug 213759

Summary: regression: mirror sync log not being properly zero'ed out
Product: Red Hat Enterprise Linux 4 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Alasdair Kergon <agk>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: dwysocha, jbrassow, mbroz, prockai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0287 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-08 00:12:27 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:

Description Corey Marthaler 2006-11-02 21:18:57 UTC
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 21:23:24 UTC
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 21:33:52 UTC
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 21:37:43 UTC
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 Program Management 2006-11-02 21:47:05 UTC
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 22:05:21 UTC
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 22:06:47 UTC
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 23:58:54 UTC
untested patches applied upstream for those two problems

Comment 9 Alasdair Kergon 2006-11-10 22:19:58 UTC
lvm2-2.02.14-1 built

Comment 10 Corey Marthaler 2006-11-14 00:08:32 UTC
fix verified in lvm2-2.02.14-1.

Comment 13 Corey Marthaler 2007-02-16 22:40:35 UTC
marking this verified again.

Comment 15 Red Hat Bugzilla 2007-05-08 00:12:27 UTC
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