Discussion:
[linux-lvm] lvm2 lvmetad hangs with 100% cpu
Pirate Fibonacci
2014-09-09 21:40:43 UTC
Permalink
All,

I'm using fedora20. fresh install. I start with an empty volume group,
vg-targetd

I've included some python code that reproduces the hang.

the script creats 11 logical volumes. attaches them to the
BlockStorageObject from the rtslib. iscsi...

then we go in to a loop calling lvscan() about the 42 iteration, the
program will hang with lvmetad going 100% cpu

using the lvm lib, I don't have this issue.

thanks

Jeffrey



#!/usr/bin/python
from lvm2py import *
from rtslib import BlockStorageObject

lvm = LVM()
vg_list_obj = lvm.vgscan()
lv_list_obj = {}
target_count = 12
volume_size = 1
vg_name = 'vg-targetd'
volume_name = "test_volume_%s"

for i in range (1,target_count):
lv_name = volume_name % (str(i).zfill(2))
so_name = "%s:%s" % (vg_name, lv_name)
vg = lvm.get_vg(vg_name, 'w')
vg.create_lv(lv_name, volume_size, 'GiB')
storageblock_obj = BlockStorageObject(so_name, dev="/dev/%s/%s" %
(vg_name, lv_name))
print 'created volume ', lv_name

i = 1
while i < 300:
vg = lvm.get_vg(vg_name, 'r')
lv_list_obj = vg.lvscan()
output = []
for lv in lv_list_obj:
output.append(dict(volume_name=lv.name, size=int(lv.size()),
uuid=lv.uuid))
print output
print i
i = i + 1


# hangs after 42 iterations with 12 volumes
Pirate Fibonacci
2014-09-10 00:02:24 UTC
Permalink
A simpler version that demonstrates bug...

thanks...

from lvm2py import *

lvm = LVM()
vg_list_obj = lvm.vgscan()
target_count = 12
volume_size = 1
vg_name = 'vg-targetd'
volume_name = "test_volume_%s"

for i in range (1,target_count):
lv_name = volume_name % (str(i).zfill(2))
vg = lvm.get_vg(vg_name, 'w')
vg.create_lv(lv_name, volume_size, 'GiB')
print 'created volume ', lv_name

i = 1
while i < 300:
vg = lvm.get_vg(vg_name, 'r')
lv_list_obj = vg.lvscan()
output = []
for lv in lv_list_obj:
output.append(dict(volume_name=lv.name, size=int(lv.size()),
uuid=lv.uuid))
print output
print i
i = i + 1
Post by Pirate Fibonacci
All,
I'm using fedora20. fresh install. I start with an empty volume group,
vg-targetd
I've included some python code that reproduces the hang.
the script creats 11 logical volumes. attaches them to the
BlockStorageObject from the rtslib. iscsi...
then we go in to a loop calling lvscan() about the 42 iteration, the
program will hang with lvmetad going 100% cpu
using the lvm lib, I don't have this issue.
thanks
Jeffrey
#!/usr/bin/python
from lvm2py import *
from rtslib import BlockStorageObject
lvm = LVM()
vg_list_obj = lvm.vgscan()
lv_list_obj = {}
target_count = 12
volume_size = 1
vg_name = 'vg-targetd'
volume_name = "test_volume_%s"
lv_name = volume_name % (str(i).zfill(2))
so_name = "%s:%s" % (vg_name, lv_name)
vg = lvm.get_vg(vg_name, 'w')
vg.create_lv(lv_name, volume_size, 'GiB')
storageblock_obj = BlockStorageObject(so_name, dev="/dev/%s/%s" %
(vg_name, lv_name))
print 'created volume ', lv_name
i = 1
vg = lvm.get_vg(vg_name, 'r')
lv_list_obj = vg.lvscan()
output = []
output.append(dict(volume_name=lv.name, size=int(lv.size()),
uuid=lv.uuid))
print output
print i
i = i + 1
# hangs after 42 iterations with 12 volumes
Loading...