Bug 976499 - why did the snapshot rounding logic change?
why did the snapshot rounding logic change?
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: LVM and device-mapper development team
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-20 12:57 EDT by Corey Marthaler
Modified: 2013-06-21 12:12 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-21 12:12:50 EDT
Type: Bug
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 2013-06-20 12:57:20 EDT
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 02:34:58 EDT
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 04:41:03 EDT
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 12:12:50 EDT
Sounds good. I'll close this bug and change the test cases accordingly. Thanks.

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