Bug 138019 - get_extents_for_PV: parses incorrectly for multiple Logical extents, can hang GUI
get_extents_for_PV: parses incorrectly for multiple Logical extents, can hang...
Status: CLOSED RAWHIDE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: system-config-lvm (Show other bugs)
4.0
All Linux
medium Severity high
: ---
: ---
Assigned To: Jim Parsons
Jim Parsons
:
Depends On:
Blocks: 135876
  Show dependency treegraph
 
Reported: 2004-11-03 16:23 EST by Derek Anderson
Modified: 2009-04-16 19:10 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-04 09:11:23 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 Derek Anderson 2004-11-03 16:23:04 EST
Description of problem:
This might be a doosie.

Setup:
- VG of the following disks and sizes:
 sda1 = 34728 4K extents = 135.66GB
 sdb1 = 17365 4K extents = 67.83GB
 sdc1 = 11576 4K extents = 45.22GB

- Create an LV of 63669 extents (~171112MB) in 2 64K stripes

==========================================
Here is the resulting extent mapping:

[root@link-12 root]# lvdisplay -m
  --- Logical volume ---
  LV Name                /dev/VG1/STRIPER
  VG Name                VG1
  LV UUID                3SAX0o-UkFb-F07e-Q4mG-qfG7-g7Eo-q0vjnS
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                167.10 GB
  Current LE             42778
  Segments               2
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:0

  --- Segments ---
  Logical extent 0 to 34729:
    Type                striped
    Stripes             2
    Stripe size         64 KB
    Stripe 0:
      Physical volume   /dev/sda1
      Physical extents  0 to 17364
    Stripe 1:
      Physical volume   /dev/sdb1
      Physical extents  0 to 17364

  Logical extent 34730 to 42777:
    Type                striped
    Stripes             2
    Stripe size         64 KB
    Stripe 0:
      Physical volume   /dev/sda1
      Physical extents  17365 to 21388
    Stripe 1:
      Physical volume   /dev/sdc1
      Physical extents  0 to 4023

====================================

As you can see above, this is broken into two Logical extents.  The
result in the GUI is:
17365 extents used on sda1 as Stripe 0 (This is wrong)
17365 extents used on sdb1 as Stripe 1
4024 extents used on sdc1 as Stripe 1

The immediate display issue is that PEs 17365 to 21388 on sda1 are not
showing up.

The hang can occur if you then create another LV on sda1.  There GUI
hangs trying to parse.  When killed you get this backtrace:

=======================================
Traceback (most recent call last):
  File "/usr/sbin/system-config-lvm", line 99, in ?
    runFullGUI()
  File "/usr/sbin/system-config-lvm", line 84, in runFullGUI
    blvm = baselvm(glade_xml, app)
  File "/usr/sbin/system-config-lvm", line 68, in __init__
    self.volume_tab_view = Volume_Tab_View(glade_xml, self.lvmm,
self.main_win)
  File "/usr/share/system-config-lvm/Volume_Tab_View.py", line 128, in
__init__
    self.prepare_tree()
  File "/usr/share/system-config-lvm/Volume_Tab_View.py", line 177, in
prepare_t
ree
    pv_list = self.model_factory.query_PVs_for_VG(vg_name)
  File "/usr/share/system-config-lvm/lvm_model.py", line 276, in
query_PVs_for_V
G
    pv_s = self.query_PVs()
  File "/usr/share/system-config-lvm/lvm_model.py", line 268, in query_PVs
    self.get_extents_for_PV(pv)
  File "/usr/share/system-config-lvm/lvm_model.py", line 826, in
get_extents_for
_PV
    for j in range(0, len(extentlist) - 1):
KeyboardInterrupt
====================================

Once in this state you have to lvremove from the command line to recover.

I'm surprised that the lvcreate of these two stripes worked at all.  I
had assumed that if there was not enough contiguous space on any PVs
for the full stripe that LVM would fail.  ?  Apparently not.

Version-Release number of selected component (if applicable):
system-config-lvm-0.9.3-1.0

How reproducible:
100% with the a recipe similar to the one above.

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Jim Parsons 2004-11-10 10:23:29 EST
The part of this ticket that describes GUI hang is fixed in 0.9.8-1.0

Bad logic in the get_extents_for_PV call hung in a specific cornercase.

Perhaps now the other issue will be easier to debug without the GUI
crashing. Marking as qa_ready to separate the striping issue away from
this other issue.
Comment 2 Derek Anderson 2004-11-11 16:34:17 EST
Jim,

There is no longer a hang or crash.  There is still something
incorrect with the extent display.  I can show you this on my test
system when you are ready to look at it.
Comment 3 Jim Parsons 2004-11-16 12:21:17 EST
Display issue fixed in 0.9.11-1.0. This finishes this ticket off.
Comment 4 Derek Anderson 2004-11-17 14:32:44 EST
sda1 = 34721 extents
sdb1 = 17358 extents
sdc1 = 11569 extents

Create a VG with these three called "VG1"
Create a LV called "LV1" of 50000 extents, 2 stripes of 64K.

At this point the GUI looks like it is displaying the used extents
correctly, which from lvdisplay -m is now:
[root@link-12 /]# lvdisplay -m
  --- Logical volume ---
  LV Name                /dev/VG1/LV1
  VG Name                VG1
  LV UUID                WBHesP-189L-mRrg-cDtQ-QLFe-mseV-9h4jHJ
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                195.31 GB
  Current LE             50000
  Segments               2
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:0

  --- Segments ---
  Logical extent 0 to 34715:
    Type                striped
    Stripes             2
    Stripe size         64 KB
    Stripe 0:
      Physical volume   /dev/sda1
      Physical extents  0 to 17357
    Stripe 1:
      Physical volume   /dev/sdb1
      Physical extents  0 to 17357

  Logical extent 34716 to 49999:
    Type                striped
    Stripes             2
    Stripe size         64 KB
    Stripe 0:
      Physical volume   /dev/sda1
      Physical extents  17358 to 24999
    Stripe 1:
      Physical volume   /dev/sdc1
      Physical extents  0 to 7641

=====================================
Now create another LV "LV2" on VG1; linear, containing the rest of
the extents on VG1.

Get the following traceback and the GUI is rendered inoperable, 
i.e. the traceback is redumped every time you click on something in
the GUI:

Traceback (most recent call last):
  File "/usr/share/system-config-lvm/InputController.py", line 803, in
on_ok_new_lv_button
    apply(self.reset_tree_model, args)
  File "/usr/share/system-config-lvm/Volume_Tab_View.py", line 134, in
reset_tree_model
    self.prepare_tree()
  File "/usr/share/system-config-lvm/Volume_Tab_View.py", line 200, in
prepare_tree
    pv_list = self.model_factory.query_PVs_for_VG(vg_name)
  File "/usr/share/system-config-lvm/lvm_model.py", line 275, in
query_PVs_for_VG
    pv_s = self.query_PVs()
  File "/usr/share/system-config-lvm/lvm_model.py", line 267, in query_PVs
    self.get_extents_for_PV(pv)
  File "/usr/share/system-config-lvm/lvm_model.py", line 857, in
get_extents_for_PV
    next = extentlist[k+1]
IndexError: list index out of range
Comment 5 Jim Parsons 2004-11-17 18:28:28 EST
Ha! Had a list index limit set to leniently. Fixed in 0.9.12-1.0
Comment 6 Derek Anderson 2004-11-19 16:35:39 EST
Looks good.  Verified in system-config-lvm-0.9.12-1.0.
Comment 9 Jay Turner 2004-12-04 09:11:23 EST
system-config-lvm-0.9.18-1.0 is in re1201.0.  Closing out.

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