Bug 144874 - Attempting to take snapshot # 9 of an LV results in device mapper "Cannot allocate memory" and locks the original.
Attempting to take snapshot # 9 of an LV results in device mapper "Cannot all...
Status: CLOSED DUPLICATE of bug 132057
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: device-mapper (Show other bugs)
4.0
ia32e Linux
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-12 03:42 EST by Mitchell Brandsma
Modified: 2010-01-11 21:14 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 14:07:52 EST
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 Mitchell Brandsma 2005-01-12 03:42:29 EST
Description of problem:

A volume group which I have converted from lvm1 to lvm2 causes 
problems when attempting to snapshot any logical volume for the 9th 
time.  Note that I can take many snapshots, but it appears shapshot 
number 9 of any LV causes the problem.

Either there is a coded limit of 8 snapshots, and the commands need 
to prevent attempt number 9, or there is a bug trying to take it.

The problem does not appear to be in any way hardware related.
Snapshot # 9 (/dev/rootvg/test9) does not appear.  I can still 
perform vg/lv operations, and can even perform an lvremove of the 
attempted snapshot # 9, but need to reboot to be able to 
access /dev/rootvg/tmp again.

Version-Release number of selected component (if applicable):


How reproducible:

Every time



Steps to Reproduce:
1. Installed basic RH EL3 and upgraded to EL4 beta 2.  All lvm 
filesystems except /boot. (I believe it will happen from a fresh EL4 
install but we had issues with our install disk on the EM64T, so we 
installed EL3 and upgraded).
2. vgconvert -M 2 rootvg (I believe an install straight onto LVM2 
filesystems will also perform the same).
3. Snapshot one of the LVs 8 times...
4. Try to take snapshot # 9 of the same LV:
[root@el4beta test2]# lvcreate -s -L 1M -n test7 /dev/rootvg/tmp
  
Actual results:

Error trying to create snapshot 9:
  Rounding up size to full physical extent 16.00 MB
  device-mapper ioctl cmd 9 failed: Cannot allocate memory
  Couldn't load device 'rootvg-test4'.
  Problem reactivating origin tmp

Note that I was trying to create /dev/rootvg/test7 
(aka /dev/mapper/rootvg-test7) and it says it couldn't load device 
rootvg-test4 - that's not what I asked for!

At this point /tmp is locked and any attempts to access it or a 
mounted snapshot(ls, app uses a temp file, or whatever) are met by a 
system wait.  Other commands/functions as they should.


Expected results:

If this is a limitation (max 8 snapshots of any particular LV), the 
command should have refused politely.  Otherwise the device mapper 
should have created the rootvg-test7 snapshot.


Additional info:

 here is the order they were created in:
[root@el4beta ~]# lvcreate -s -L 1M -n test /dev/rootvg/tmp
  Rounding up size to full physical extent 16.00 MB
  Logical volume "test" created                               (# 1)
[root@el4beta ~]# lvcreate -s -L 1M -n test9 /dev/rootvg/tmp  
Rounding up size to full physical extent 16.00 MB
  Logical volume "test9" created                             (# 2)
[root@el4beta ~]# lvcreate -s -L 1M -n test1 /dev/rootvg/tmp  
Rounding up size to full physical extent 16.00 MB
  Logical volume "test1" created                             (# 3)

... snapshots 4-7 (test2-5) follow along the same lines, finally...

[root@el4beta test2]# lvcreate -s -L 1M -n test6 /dev/rootvg/tmp  
Rounding up size to full physical extent 16.00 MB
  Logical volume "test6" created                         **(# 8)
Comment 1 Alasdair Kergon 2005-01-12 09:02:34 EST
Each snapshot requires a certain amount of (not-swappable) kernel
memory, and you've run out:-(

Work is underway to improve the way this situation is handled and to
increase the amount of memory available.
Comment 2 Alasdair Kergon 2005-01-12 09:04:21 EST

*** This bug has been marked as a duplicate of 132057 ***
Comment 3 Mitchell Brandsma 2005-01-12 17:12:50 EST
Hmmm, it must scale non-linearly.  I can happily take those first 8 
snapshots, then:
* Try to take one more snapshot, at which point it falls over, or
* Take another 4 snapshots of a different filesystem without any 
problems (number 5 of the second set fell over on the test I just did 
though).

I'll leave you all to it.
Comment 4 Red Hat Bugzilla 2006-02-21 14:07:52 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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