Bug 976499

Summary: why did the snapshot rounding logic change?
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Default / Unclassified QA Contact: cluster-qe <cluster-qe>
Status: CLOSED NOTABUG Docs Contact:
Severity: medium    
Priority: medium CC: agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, prockai, thornber, zkabelac
Version: 7.0Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-21 16:12:50 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 2013-06-20 16:57:20 UTC
Description of problem:
...and is this now expected behavior for the tests?

# RHEL6.4:
[root@taft-01 ~]# lvcreate -s /dev/snapper_thinp/origin -n testsnap -L 900T
  Volume group "snapper_thinp" has insufficient free space (173393 extents): 235929600 required.


# RHEL7.0 (REAL SNAP):
[root@qalvm-01 ~]# lvcreate -s /dev/snapper/origin -n testsnap -L 1000T
  Reducing COW size 1000.00 TiB down to maximum usable size 304.00 MiB.
  Logical volume "testsnap" created
[root@qalvm-01 ~]# lvs -a -o +devices
  LV       VG            Attr      LSize   Origin Data%  Devices
  origin   snapper       owi-a-s-- 300.00m               /dev/vdh1(0)
  testsnap snapper       swi-a-s-- 304.00m origin   0.00 /dev/vdh1(75)

# RHEL7.0 (THINPOOL SNAP):
[root@qalvm-01 ~]# lvcreate -s /dev/snapper_thinp/origin -n testsnap -L 1000T
  Reducing COW size 1000.00 TiB down to maximum usable size 1.01 GiB.
  Logical volume "testsnap" created
[root@qalvm-01 ~]# lvs -a -o +devices
  LV           VG            Attr      LSize  Pool Origin Data%  Devices
  POOL         snapper_thinp twi-a-tz-  1.00g               0.00 POOL_tdata(0)
  [POOL_tdata] snapper_thinp Twi-ao---  1.00g                    /dev/vdh1(0)
  [POOL_tmeta] snapper_thinp ewi-ao---  4.00m                    /dev/vdd1(0)
  origin       snapper_thinp owi-a-tz-  1.00g POOL          0.00
  other1       snapper_thinp Vwi-a-tz-  1.00g POOL          0.00
  other2       snapper_thinp Vwi-a-tz-  1.00g POOL          0.00
  other3       snapper_thinp Vwi-a-tz-  1.00g POOL          0.00
  other4       snapper_thinp Vwi-a-tz-  1.00g POOL          0.00
  other5       snapper_thinp Vwi-a-tz-  1.00g POOL          0.00
  testsnap     snapper_thinp swi-a-s--  1.01g      origin   0.00 /dev/vdg1(0)

Version-Release number of selected component (if applicable):
3.8.0-0.40.el7.x86_64
lvm2-2.02.99-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
lvm2-libs-2.02.99-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
lvm2-cluster-2.02.99-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
device-mapper-1.02.78-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
device-mapper-libs-1.02.78-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
device-mapper-event-1.02.78-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
device-mapper-event-libs-1.02.78-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
cmirror-2.02.99-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013


How reproducible:
Everytime

Comment 1 Marian Csontos 2013-06-21 06:34:58 UTC
It does not make much sense creating snapshot device which is much larger than the origin (maybe except when snapshot is RW and is lvextended later.)

Comment 2 Zdenek Kabelac 2013-06-21 08:41:03 UTC
Yes - snapshot now calculates maximum usable size of COW device and will avoid wasting disk space to be allocated for unusable part of COW device.

Basically it's fulfilling RFE from bug 916746.

So it also handles automatic resize and should avoid wasting disk space when snapshot reaches 100% usage and covers whole origin.

Comment 3 Corey Marthaler 2013-06-21 16:12:50 UTC
Sounds good. I'll close this bug and change the test cases accordingly. Thanks.