Bug 1257366

Summary: too many left over archive files cause "Reserved memory" errors during virt volume creation
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Peter Rajnoha <prajnoha>
lvm2 sub component: Thin Provisioning QA Contact: cluster-qe <cluster-qe>
Status: CLOSED WONTFIX Docs Contact:
Severity: low    
Priority: low CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, thornber, zkabelac
Version: 7.2Keywords: 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: 2016-01-22 15:44:21 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 2015-08-26 22:36:53 UTC
Description of problem:
This may be expected behavior, but it took me a long time to figure out why I was starting to see these errors with just a single virt create attempt yet didn't see it with other types of volume attempts.


[root@host-112 archive]# vgs
  VG            #PV #LV #SN Attr   VSize VFree 
  rhel_host-112   1   2   0 wz--n- 7.51g 40.00m


[root@host-112 archive]# pwd
/etc/lvm/archive
[root@host-112 archive]# ls -l snapper_thinp* | wc -l
31019
[root@host-112 archive]# ls -l vg* | wc -l
4


[root@host-112 archive]# vgcreate vg /dev/sda1
  Volume group "vg" successfully created
[root@host-112 archive]# vgcreate snapper_thinp /dev/sdb1
  Volume group "snapper_thinp" successfully created

[root@host-112 archive]# lvcreate --thinpool POOL1 -L 1G vg
  Logical volume "POOL1" created.
[root@host-112 archive]# lvcreate --thinpool POOL1 -L 1G snapper_thinp
  Logical volume "POOL1" created.

[root@host-112 archive]# lvcreate  --virtualsize 1G -T vg/POOL1 -n origin
  Logical volume "origin" created.
[root@host-112 archive]# lvcreate  --virtualsize 1G -T snapper_thinp/POOL1 -n origin
  Internal error: Reserved memory (19165184) not enough: used 20692992. Increase activation/reserved_memory?
  Logical volume "origin" created.

[root@host-112 archive]# lvs -a -o +devices
  LV              VG            Attr       LSize Pool  Data%  Meta% Devices
  POOL1           snapper_thinp twi-aotz-- 1.00g       0.00   1.07  POOL1_tdata(0)
  [POOL1_tdata]   snapper_thinp Twi-ao---- 1.00g                    /dev/sdb1(1)
  [POOL1_tmeta]   snapper_thinp ewi-ao---- 4.00m                    /dev/sdb1(257)
  [lvol0_pmspare] snapper_thinp ewi------- 4.00m                    /dev/sdb1(0)
  origin          snapper_thinp Vwi-a-tz-- 1.00g POOL1 0.00

  POOL1           vg            twi-aotz-- 1.00g       0.00   1.07  POOL1_tdata(0)
  [POOL1_tdata]   vg            Twi-ao---- 1.00g                    /dev/sda1(1)  
  [POOL1_tmeta]   vg            ewi-ao---- 4.00m                    /dev/sda1(257)
  [lvol0_pmspare] vg            ewi------- 4.00m                    /dev/sda1(0)  
  origin          vg            Vwi-a-tz-- 1.00g POOL1 0.00


If I try and create other types of volumes on the volume group snapper_thinp I don't see this error.


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

lvm2-2.02.128-1.el7    BUILT: Tue Aug 18 03:45:17 CDT 2015
lvm2-libs-2.02.128-1.el7    BUILT: Tue Aug 18 03:45:17 CDT 2015
lvm2-cluster-2.02.128-1.el7    BUILT: Tue Aug 18 03:45:17 CDT 2015
device-mapper-1.02.105-1.el7    BUILT: Tue Aug 18 03:45:17 CDT 2015
device-mapper-libs-1.02.105-1.el7    BUILT: Tue Aug 18 03:45:17 CDT 2015
device-mapper-event-1.02.105-1.el7    BUILT: Tue Aug 18 03:45:17 CDT 2015
device-mapper-event-libs-1.02.105-1.el7    BUILT: Tue Aug 18 03:45:17 CDT 2015
device-mapper-persistent-data-0.5.5-1.el7    BUILT: Thu Aug 13 09:58:10 CDT 2015
cmirror-2.02.128-1.el7    BUILT: Tue Aug 18 03:45:17 CDT 2015
sanlock-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
sanlock-lib-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
lvm2-lockd-2.02.128-1.el7    BUILT: Tue Aug 18 03:45:17 CDT 2015

Comment 1 Jonathan Earl Brassow 2016-01-22 15:44:21 UTC
We have 'retain_min' and 'retain_days', which ensure preservation of archive files, but we have nothing to set the upper bound for shorter time periods than 'retain_days'.

If you set 'retain_days' to, say '1', then after a day, any files that are more than a day old will be removed... as long as the most recent 'retain_min' are always kept.

Try that and see if you like it as a solution.  If not, you can reopen this bug.