Bug 787474 - ovirt-engine-core: we need to add rollback for updating db with lun list when GetVGInfo from vdsm returns partial results during CreateStoragePoolVDSCommand/CreateStorageDomainVDSCommand
Summary: ovirt-engine-core: we need to add rollback for updating db with lun list when...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: unspecified
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: 3.3.4
Assignee: lpeer
QA Contact:
URL:
Whiteboard: storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-05 14:50 UTC by Dafna Ron
Modified: 2016-02-10 16:47 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-10 19:10:52 UTC
oVirt Team: Storage


Attachments (Terms of Use)
logs (688.02 KB, application/x-gzip)
2012-02-05 14:50 UTC, Dafna Ron
no flags Details

Description Dafna Ron 2012-02-05 14:50:42 UTC
Created attachment 559466 [details]
logs

Description of problem:

I had a lun that due to a vdsm issue we manage to connect and login to but is not written in vg's metadata. 
as a result, although we add the domain and although everything seems ok with it, since GetVGInfo only returns 2 out of the 3 luns, the lun is not updated in DB and when we try to connect other hosts or disconnect the current one we are getting an error from vdsm that domain does not exist. 
since updating the db with luns is a part of the flow for CreateStoragePoolVDSCommand, we should add rollback in cases in which CreateStoragePoolVDSCommand or CreateStorageDomainVDSCommand succeeded but we failed to update the db with the target luns due to partial return from GetVGInfo from vdsm. 


as you can see, I added 3 luns but GetVGInfo only got 2: 

2012-02-05 14:34:54,449 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVGVDSCommand] (http--0.0.0.0-8080-2) START, CreateVGVDSCommand(vdsId = eea4708a-4cd8-11e1-a773-001a4a169741, storageDomainId=990a1dc6-c5ca-4d55-b974-b3375c5791b2, deviceList=[1Dafna-011328104, 1Dafna-021328104, 1Dafna-031328104]), log id: 380bb287

2012-02-05 14:35:06,566 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVGInfoVDSCommand] (http--0.0.0.0-8080-2) START, GetVGInfoVDSCommand(vdsId = eea4708a-4cd8-11e1-a773-001a4a169741, VGID=DUmOcS-mvdS-QJWX-ChYv-ySlL-fgCx-DTVct4), l
og id: 79f67290
2012-02-05 14:35:06,669 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVGInfoVDSCommand] (http--0.0.0.0-8080-2) FINISH, GetVGInfoVDSCommand, return: [org.ovirt.engine.core.common.businessentities.LUNs@95a4691e, org.ovirt.engine.core
.common.businessentities.LUNs@1dcdd3cf], log id: 79f67290


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

ovirt-engine-backend-3.0.0_0001-1.4.fc16.x86_64

How reproducible:

100%

Steps to Reproduce:
1. after CreateStorageDomainVDSCommand remove the lun from domain MTD
2. GetVGInfo should return with the lun missing
3.
  
Actual results:

CreateStorageDomainVDSCommand operation should fail and rollback

Expected results:

domain is created but DB is not added to db. 

Additional info:full logs

db was not updated: 

[root@dafna-web-admin ~]# psql -U postgres -d engine -c "SELECT *  from luns "
           phisical_volume_id           |              lun_id               |            volume_group_id             |           serial           | lun_mapping | vendor_id |  product_id  | device_size 
----------------------------------------+-----------------------------------+----------------------------------------+----------------------------+-------------+-----------+--------------+-------------
 jPv4NU-oP7Z-T364-zHOF-TKqf-2dnI-8QrhUF | 1Dafna-Main1328104                | Ep025D-MUVM-1dh5-Aikg-CXKw-JQjg-QyavNj | SIET_VIRTUAL-DISK          |           1 | IET       | VIRTUAL-DISK |         100
 PziVse-JGU9-rJph-e4N9-7Dvm-Pw2A-B3rf7c | 3600144f05530480000004f295c0f0012 | tX7duY-OQic-sc2z-z9cv-EQRm-dIRq-8Kkism | SNEXENTA_COMSTAR_7HHI8D7AB |           3 | NEXENTA   | COMSTAR      |          75
 wA2PWr-8ba4-bb3r-usHT-lusw-QpDm-Ve5ou6 | 1Dafna-011328104                  | GnpvYj-xRBv-ZxrX-C1Rk-Qnwn-HBcw-1JdAYA | SIET_VIRTUAL-DISK          |           1 | IET       | VIRTUAL-DISK |          20
 urIgS6-KZvk-S9Ct-5MvZ-pXBq-4sPw-LN9lt1 | 1Dafna-031328104                  | GnpvYj-xRBv-ZxrX-C1Rk-Qnwn-HBcw-1JdAYA | SIET_VIRTUAL-DISK          |           1 | IET       | VIRTUAL-DISK |          20


iscsiadm will show targets connected: 

[root@blond-vdsf ~]# iscsiadm -m session
tcp: [80] 10.35.64.10:3260,1 Daffi-01
tcp: [81] 10.35.64.10:3260,1 Daffi-02
tcp: [82] 10.35.64.10:3260,1 Daffi-03


we can see that vg exists: 

root@blond-vdsf ~]# vgs
  VG                                   #PV #LV #SN Attr   VSize  VFree 
  990a1dc6-c5ca-4d55-b974-b3375c5791b2   3   6   0 wz--n- 58.88g 55.00g
  vg0                                    1   3   0 wz--n- 74.01g     0 



due to vdsm issue the vg is not written to metadata and we can see that the vdsm returns only 2 luns in getVGInfo:

Thread-5894::INFO::2012-02-05 14:33:39,592::logUtils::39::dispatcher::(wrapper) Run and protect: getVGInfo, Return response: {'info': {'state': 'OK', 'vgsize': '63216549888', 'name': '990a1dc6-c5ca-4d55-b974-b3375c5791b2', 'vgfree': '590
55800320', 'vgUUID': 'DUmOcS-mvdS-QJWX-ChYv-ySlL-fgCx-DTVct4', 'pvlist': [{'vendorID': 'IET', 'capacity': '21072183296', 'fwrev': '0000', 'vgUUID': 'DUmOcS-mvdS-QJWX-ChYv-ySlL-fgCx-DTVct4', 'pathlist': [{'initiator': 'iqn.1994-05.com.red
hat:c31fb8123836', 'connection': '10.35.64.10', 'iqn': 'Dafna-01', 'portal': '1', 'user': '', 'password': '', 'port': '3260'}], 'pathstatus': [{'physdev': 'sdb', 'state': 'active', 'type': 'iSCSI', 'lun': '1'}], 'devtype': 'iSCSI', 'pvUU
ID': 'D559Wz-Defw-xm3t-6qKR-BMI3-UwVM-6lqlcL', 'serial': 'SIET_VIRTUAL-DISK', 'GUID': '1Dafna-011328104', 'devcapacity': '21474836480', 'productID': 'VIRTUAL-DISK'}, {'vendorID': 'IET', 'capacity': '21072183296', 'fwrev': '0000', 'vgUUID
': 'DUmOcS-mvdS-QJWX-ChYv-ySlL-fgCx-DTVct4', 'pathlist': [{'initiator': 'iqn.1994-05.com.redhat:c31fb8123836', 'connection': '10.35.64.10', 'iqn': 'Dafna-03', 'portal': '1', 'user': '', 'password': '', 'port': '3260'}], 'pathstatus': [{'
physdev': 'sdd', 'state': 'active', 'type': 'iSCSI', 'lun': '1'}], 'devtype': 'iSCSI', 'pvUUID': 'Jd6DTJ-bcvm-WOqf-5E4B-claA-PDs7-bKBolQ', 'serial': 'SIET_VIRTUAL-DISK', 'GUID': '1Dafna-031328104', 'devcapacity': '21474836480', 'productI

in engine log we can see that the command succeeded although I got a partial list of luns from vdsm (lun 1Dafna-021328104 is missing): 

2012-02-05 14:34:54,449 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVGVDSCommand] (http--0.0.0.0-8080-2) START, CreateVGVDSCommand(vdsId = eea4708a-4cd8-11e1-a773-001a4a169741, storageDomainId=990a1dc6-c5ca-4d55-b974-b3375c5791b2, deviceList=[1Dafna-011328104, 1Dafna-021328104, 1Dafna-031328104]), log id: 380bb287


2012-02-05 14:34:56,731 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStorageDomainVDSCommand] (http--0.0.0.0-8080-2) START, CreateStorageDomainVDSCommand(vdsId = eea4708a-4cd8-11e1-a773-001a4a169741, storageDomain=org.ovirt.eng
ine.core.common.businessentities.storage_domain_static@4c1ce1d0, args=DUmOcS-mvdS-QJWX-ChYv-ySlL-fgCx-DTVct4), log id: 7e22a6fb
2012-02-05 14:35:05,704 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStorageDomainVDSCommand] (http--0.0.0.0-8080-2) FINISH, CreateStorageDomainVDSCommand, log id: 7e22a6fb
2012-02-05 14:35:05,707 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand] (http--0.0.0.0-8080-2) START, GetStorageDomainStatsVDSCommand(vdsId = eea4708a-4cd8-11e1-a773-001a4a169741, storageDomainId=990a1dc
6-c5ca-4d55-b974-b3375c5791b2), log id: 346a1b2a
2012-02-05 14:35:06,533 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand] (http--0.0.0.0-8080-2) FINISH, GetStorageDomainStatsVDSCommand, return: org.ovirt.engine.core.common.businessentities.storage_domai
ns@e8007d05, log id: 346a1b2a
2012-02-05 14:35:06,566 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVGInfoVDSCommand] (http--0.0.0.0-8080-2) START, GetVGInfoVDSCommand(vdsId = eea4708a-4cd8-11e1-a773-001a4a169741, VGID=DUmOcS-mvdS-QJWX-ChYv-ySlL-fgCx-DTVct4), l
og id: 79f67290
2012-02-05 14:35:06,669 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVGInfoVDSCommand] (http--0.0.0.0-8080-2) FINISH, GetVGInfoVDSCommand, return: [org.ovirt.engine.core.common.businessentities.LUNs@95a4691e, org.ovirt.engine.core
.common.businessentities.LUNs@1dcdd3cf], log id: 79f67290
2012-02-05 14:35:06,901 INFO  [org.ovirt.engine.core.bll.storage.AttachStorageDomainToPoolCommand] (http--0.0.0.0-8080-2) Running command: AttachStorageDomainToPoolCommand internal: false. Entities affected :  ID: 990a1dc6-c5ca-4d55-b974
-b3375c5791b2 Type: Storage
2012-02-05 14:35:06,901 INFO  [org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand] (http--0.0.0.0-8080-2) Lock Acquired to object EngineLock [exclusiveLocks= key: org.ovirt.engine.core.bll.storage.AddStoragePoolWithStora
gesCommand value: caacfe0f-c2ea-4a28-8959-751505826a2b
, sharedLocks= ]
2012-02-05 14:35:06,913 INFO  [org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand] (http--0.0.0.0-8080-2) Running command: AddStoragePoolWithStoragesCommand internal: true. Entities affected :  ID: caacfe0f-c2ea-4a28-895
9-751505826a2b Type: StoragePool

D': 'VIRTUAL-DISK'}], 'type': 3, 'attr': {'allocation': 'n', 'partial': '-', 'exported': '-', 'permission': 'w', 'clustered': '-', 'resizeable': 'z'}}}

Comment 1 Itamar Heim 2012-12-10 19:10:52 UTC
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.


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