Skip to content

Commit

Permalink
CA-332978: Only force reload multipath on start
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Syms <mark.syms@citrix.com>
  • Loading branch information
MarkSymsCtx committed May 20, 2020
1 parent e3a35d7 commit 45c4009
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions drivers/XE_SR_ERRORCODES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,11 @@
<description>Multipath generic failure</description>
<value>431</value>
</code>
<code>
<name>MultipathMapperPathMissing</name>
<description>Device Mapper path missing</description>
<value>432</value>
</code>
<code>
<name>TapdiskAlreadyRunning</name>
<description>The tapdisk is already running</description>
Expand Down
14 changes: 10 additions & 4 deletions drivers/mpath_dmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,18 @@ def _is_valid_multipath_device(sid):
def _refresh_DMP(sid, npaths):
if not _is_valid_multipath_device(sid):
return
util.retry(lambda: util.pread2(['/usr/sbin/multipath', '-r', sid]), maxretry = 3,
period = 4)
path = os.path.join(DEVMAPPERPATH, sid)
util.wait_for_path(path, 10)
# If the mapper path doesn't exist force a reload in multipath
if not os.path.exists(path):
raise xs_errors.XenError('DMP failed to activate mapper path')
util.retry(lambda: util.pread2(
['/usr/sbin/multipath', '-r', sid]),
maxretry = 3,
period = 4)
util.wait_for_path(path, 10)
if not os.path.exists(path):
raise xs_errors.XenError('MultipathMapperPathMissing',
'Device mapper path {} not found'.format(
path))
lvm_path = "/dev/disk/by-scsid/"+sid+"/mapper"
util.wait_for_path(lvm_path, 10)
activate_MPdev(sid, path)
Expand Down

0 comments on commit 45c4009

Please sign in to comment.