Bug 833381

Summary: 3.1 - [Storage] Disconnect storage pool thorough an exception.
Product: Red Hat Enterprise Linux 6 Reporter: Leonid Natapov <lnatapov>
Component: vdsmAssignee: Eduardo Warszawski <ewarszaw>
Status: CLOSED NOTABUG QA Contact: Haim <hateya>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3CC: abaron, bazulay, iheim, syeghiay, yeylon, ykaul
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: Storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-12 08:29:20 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:
Attachments:
Description Flags
vdsm log none

Description Leonid Natapov 2012-06-19 11:11:19 UTC
Created attachment 592915 [details]
vdsm log

[Storage] Disconnect storage pool thorough an exception.
I was trying to switch to maintenance Master SD. Here is the exception.
When I tried to activate Master I got another exception saying that version or spm id is invalid. It described in BZ833084. This bug and the current bug might be related. VDSM log attached.

Thread-4128::DEBUG::2012-06-19 12:37:39,654::BindingXMLRPC::156::vds::(wrapper) [10.35.97.32]
Thread-4128::DEBUG::2012-06-19 12:37:39,654::task::588::TaskManager.Task::(_updateState) Task=`fe864837-2276-4a68-9d47-abbd3a88136d`::moving from
state init -> state preparing
Thread-4128::INFO::2012-06-19 12:37:39,655::logUtils::37::dispatcher::(wrapper) Run and protect: disconnectStoragePool(spUUID='347bb22d-598b-44bc-
8b05-e1b176d30bef', hostID=1, scsiKey='347bb22d-598b-44bc-8b05-e1b176d30bef', remove=False, options=None)
Thread-4128::DEBUG::2012-06-19 12:37:39,655::resourceManager::175::ResourceManager.Request::(__init__) ResName=`Storage.347bb22d-598b-44bc-8b05-e1
b176d30bef`ReqID=`94da7613-f0f8-4a08-a690-74e0a2a830c1`::Request was made in '/usr/share/vdsm/storage/resourceManager.py' line '485' at 'registerR
esource'
Thread-4128::DEBUG::2012-06-19 12:37:39,655::resourceManager::486::ResourceManager::(registerResource) Trying to register resource 'Storage.347bb2
2d-598b-44bc-8b05-e1b176d30bef' for lock type 'exclusive'
Thread-4128::DEBUG::2012-06-19 12:37:39,655::resourceManager::528::ResourceManager::(registerResource) Resource 'Storage.347bb22d-598b-44bc-8b05-e
1b176d30bef' is free. Now locking as 'exclusive' (1 active user)
Thread-4128::DEBUG::2012-06-19 12:37:39,656::resourceManager::212::ResourceManager.Request::(grant) ResName=`Storage.347bb22d-598b-44bc-8b05-e1b17
6d30bef`ReqID=`94da7613-f0f8-4a08-a690-74e0a2a830c1`::Granted request
Thread-4128::DEBUG::2012-06-19 12:37:39,656::task::817::TaskManager.Task::(resourceAcquired) Task=`fe864837-2276-4a68-9d47-abbd3a88136d`::_resourc
esAcquired: Storage.347bb22d-598b-44bc-8b05-e1b176d30bef (exclusive)
Thread-4128::DEBUG::2012-06-19 12:37:39,656::task::978::TaskManager.Task::(_decref) Task=`fe864837-2276-4a68-9d47-abbd3a88136d`::ref 1 aborting Fa
lse
Thread-4128::INFO::2012-06-19 12:37:39,657::sp::659::Storage.StoragePool::(disconnect) Disconnect from the storage pool 347bb22d-598b-44bc-8b05-e1
b176d30bef
Thread-4128::ERROR::2012-06-19 12:37:39,657::task::853::TaskManager.Task::(_setError) Task=`fe864837-2276-4a68-9d47-abbd3a88136d`::Unexpected erro
r
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/task.py", line 861, in _run
    return fn(*args, **kargs)
  File "/usr/share/vdsm/logUtils.py", line 38, in wrapper
    res = f(*args, **kwargs)
  File "/usr/share/vdsm/storage/hsm.py", line 901, in disconnectStoragePool
    return self._disconnectPool(pool, hostID, scsiKey, remove)
  File "/usr/share/vdsm/storage/hsm.py", line 905, in _disconnectPool

Comment 3 Eduardo Warszawski 2012-07-12 08:29:20 UTC
The complete trace is:

Thread-4128::ERROR::2012-06-19 12:37:39,657::task::853::TaskManager.Task::(_setError) Task=`fe864837-2276-4a68-9d47-abbd3a88136d`::Unexpected error
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/task.py", line 861, in _run
    return fn(*args, **kargs)
  File "/usr/share/vdsm/logUtils.py", line 38, in wrapper
    res = f(*args, **kwargs)
  File "/usr/share/vdsm/storage/hsm.py", line 901, in disconnectStoragePool
    return self._disconnectPool(pool, hostID, scsiKey, remove)
  File "/usr/share/vdsm/storage/hsm.py", line 905, in _disconnectPool
    res = pool.disconnect()
  File "/usr/share/vdsm/storage/sp.py", line 677, in disconnect
    fileUtils.safeUnlink(self._poolFile)
AttributeError: 'module' object has no attribute 'safeUnlink'

The actual master code uses os.unlink() instead the inexistent fileUtils.safeUnlink().
The same is true for the 3.1 and 3.0 branches.
Our git history show no traces of fileUtils.safeUnlink() calls.
Seems that this bug was present only in a private build.
Please verify on an official build and reopen if reproduced.