Bug 853710 - 3.1 - [vdsm] deactivateStorageDomain fails due to "storage domain does not exist" (Problem with handler, treating as timeout)
3.1 - [vdsm] deactivateStorageDomain fails due to "storage domain does not ex...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: vdsm (Show other bugs)
6.3
All All
unspecified Severity urgent
: rc
: 6.4
Assigned To: Federico Simoncelli
Dafna Ron
storage
: Regression, TestBlocker, ZStream
: 854295 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-02 06:06 EDT by Gadi Ickowicz
Modified: 2014-12-30 03:51 EST (History)
13 users (show)

See Also:
Fixed In Version: vdsm-4.9.6-39.0
Doc Type: Bug Fix
Doc Text:
When an ISO domain was blocked and deactivateStorageDomain was sent, it failed to deactivate the storage domain and showed a "storage domain does not exist" error. Due to this, the domain never switched to inactive, and instead cycled between locked and active in the engine. This patch removes a now redundant cache that caused the error, allowing domains to switch to inactive successfully.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 14:09:17 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
vdsm + engine logs (1.75 MB, application/x-bzip)
2012-09-02 06:06 EDT, Gadi Ickowicz
no flags Details

  None (edit)
Description Gadi Ickowicz 2012-09-02 06:06:38 EDT
Created attachment 609044 [details]
vdsm + engine logs

Description of problem:
When an iso domain is blocked and deactivateStorageDomain is sent, it fails to deactivate the storage domain with "storage domain does not exist" error.

Due to this, the domain never switches to inactive, and cycles between locked and active in engine.

Thread-776::ERROR::2012-08-30 13:43:16,192::task::853::TaskManager.Task::(_setError) Task=`88337d82-334f-4623-86d0-fb589b2e33a9`::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 988, in deactivateStorageDomain
    pool.deactivateSD(sdUUID, msdUUID, masterVersion)
  File "/usr/share/vdsm/storage/securable.py", line 63, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/share/vdsm/storage/sp.py", line 1103, in deactivateSD
    masterDir = os.path.join(dom.domaindir, sd.MASTER_FS_DIR)
  File "/usr/share/vdsm/storage/sdc.py", line 47, in __getattr__
    dom = self.getRealDomain()
  File "/usr/share/vdsm/storage/sdc.py", line 51, in getRealDomain
    return self._cache._realProduce(self._sdUUID)
  File "/usr/share/vdsm/storage/sdc.py", line 123, in _realProduce
    dom = self._findDomain(sdUUID)
  File "/usr/share/vdsm/storage/sdc.py", line 147, in _findDomain
    raise se.StorageDomainDoesNotExist(sdUUID)
StorageDomainDoesNotExist: Storage domain does not exist: ('4e16961e-b86d-403b-8304-d3b5e8e409ff',)


during this time, repoStats continues to report the domain as valid:False, causing the continuous cycle back to locked:

Thread-785::INFO::2012-08-30 13:43:26,877::logUtils::39::dispatcher::(wrapper) Run and protect: repoStats, Return response: {'4e16961e-b86d-403b-8304-d3b5e8e409ff': {'delay': '0', 'lastCheck': 1346322697.6894541, 'code': 200, 'valid': False}, '81c9e011-46ac-4b1a-bb72-b22d0de3e6bd': {'delay': '0.015328168869', 'lastCheck': 1346323396.2141991, 'code': 0, 'valid': True}}


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

How reproducible:


Steps to Reproduce:
1. Block an nfs iso storage domain
2. try to deactivate the storage domain
3. check logs / query engine for storage domain status
  
Actual results:
storage domain status cycles between active and locked

Expected results:
storage domain should be inactive

Additional info:
Comment 1 Gadi Ickowicz 2012-09-02 06:13:05 EDT
(In reply to comment #0)
> Created attachment 609044 [details]
> vdsm + engine logs
> 
> Description of problem:
> When an iso domain is blocked and deactivateStorageDomain is sent, it fails
> to deactivate the storage domain with "storage domain does not exist" error.
> 
> Due to this, the domain never switches to inactive, and cycles between
> locked and active in engine.
> 
> Thread-776::ERROR::2012-08-30
> 13:43:16,192::task::853::TaskManager.Task::(_setError)
> Task=`88337d82-334f-4623-86d0-fb589b2e33a9`::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 988, in deactivateStorageDomain
>     pool.deactivateSD(sdUUID, msdUUID, masterVersion)
>   File "/usr/share/vdsm/storage/securable.py", line 63, in wrapper
>     return f(self, *args, **kwargs)
>   File "/usr/share/vdsm/storage/sp.py", line 1103, in deactivateSD
>     masterDir = os.path.join(dom.domaindir, sd.MASTER_FS_DIR)
>   File "/usr/share/vdsm/storage/sdc.py", line 47, in __getattr__
>     dom = self.getRealDomain()
>   File "/usr/share/vdsm/storage/sdc.py", line 51, in getRealDomain
>     return self._cache._realProduce(self._sdUUID)
>   File "/usr/share/vdsm/storage/sdc.py", line 123, in _realProduce
>     dom = self._findDomain(sdUUID)
>   File "/usr/share/vdsm/storage/sdc.py", line 147, in _findDomain
>     raise se.StorageDomainDoesNotExist(sdUUID)
> StorageDomainDoesNotExist: Storage domain does not exist:
> ('4e16961e-b86d-403b-8304-d3b5e8e409ff',)
> 
> 
> during this time, repoStats continues to report the domain as valid:False,
> causing the continuous cycle back to locked:
> 
> Thread-785::INFO::2012-08-30
> 13:43:26,877::logUtils::39::dispatcher::(wrapper) Run and protect:
> repoStats, Return response: {'4e16961e-b86d-403b-8304-d3b5e8e409ff':
> {'delay': '0', 'lastCheck': 1346322697.6894541, 'code': 200, 'valid':
> False}, '81c9e011-46ac-4b1a-bb72-b22d0de3e6bd': {'delay': '0.015328168869',
> 'lastCheck': 1346323396.2141991, 'code': 0, 'valid': True}}

This exception is causing a timeout error in CrabRPC. 
Relevant log lines:
hread-459::WARNING::2012-08-30 13:36:49,390::remoteFileHandler::185::Storage.CrabRPCProxy::(callCrabRPCFunction) Problem with handler, treating as timeout
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/remoteFileHandler.py", line 177, in callCrabRPCFunction
    rawLength = self._recvAll(LENGTH_STRUCT_LENGTH, timeout)
  File "/usr/share/vdsm/storage/remoteFileHandler.py", line 143, in _recvAll
    raise Timeout()
Timeout
Thread-458::ERROR::2012-08-30 13:36:49,391::task::853::TaskManager.Task::(_setError) Task=`2b78c9e2-bec9-4e87-8b74-d842225bc0f4`::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 988, in deactivateStorageDomain
    pool.deactivateSD(sdUUID, msdUUID, masterVersion)
  File "/usr/share/vdsm/storage/securable.py", line 63, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/share/vdsm/storage/sp.py", line 1103, in deactivateSD
    masterDir = os.path.join(dom.domaindir, sd.MASTER_FS_DIR)
  File "/usr/share/vdsm/storage/sdc.py", line 47, in __getattr__
    dom = self.getRealDomain()
  File "/usr/share/vdsm/storage/sdc.py", line 51, in getRealDomain
    return self._cache._realProduce(self._sdUUID)
  File "/usr/share/vdsm/storage/sdc.py", line 123, in _realProduce
    dom = self._findDomain(sdUUID)
  File "/usr/share/vdsm/storage/sdc.py", line 147, in _findDomain
    raise se.StorageDomainDoesNotExist(sdUUID)
StorageDomainDoesNotExist: Storage domain does not exist: ('4e16961e-b86d-403b-8304-d3b5e8e409ff',)


> 
> Version-Release number of selected component (if applicable):
> 4.9-31.0
> 
> How reproducible:
> 
> 
> Steps to Reproduce:
> 1. Block an nfs iso storage domain
> 2. try to deactivate the storage domain
> 3. check logs / query engine for storage domain status
>   
> Actual results:
> storage domain status cycles between active and locked
> 
> Expected results:
> storage domain should be inactive
> 
> Additional info:
Comment 4 Ayal Baron 2012-09-02 06:57:10 EDT
The code assumes that os.path.join cannot fail without considering that dom.domaindir could:

            else:
                masterDir = os.path.join(dom.domaindir, sd.MASTER_FS_DIR)

this is probably due to the move to domain proxies. Fede?
If so, we could have this problem in multiple places in the code.
Comment 5 Gadi Ickowicz 2012-09-05 10:51:51 EDT
Tested with http://gerrit.ovirt.org/#/c/7511/

Domain now deactivates successfully
Comment 6 Gadi Ickowicz 2012-09-05 11:02:33 EDT
*** Bug 854295 has been marked as a duplicate of this bug. ***
Comment 8 Ayal Baron 2012-09-12 02:07:02 EDT
(In reply to comment #5)
> Tested with http://gerrit.ovirt.org/#/c/7511/
> 
> Domain now deactivates successfully

Moving to POST according to this.
Comment 9 Haim 2012-10-17 07:29:30 EDT
clearing need info per C8.
Comment 12 Dafna Ron 2012-10-29 06:07:21 EDT
verified on si22.1
Comment 15 errata-xmlrpc 2012-12-04 14:09:17 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-1508.html

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