From: John Griffith Date: Wed, 25 Feb 2015 05:53:26 +0000 (+0000) Subject: Revert "Remove retry_deactivation directive on lvremove" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f9a9c02a6f98f84468c8cc7d1ae2e52c2c707432;p=openstack-build%2Fcinder-build.git Revert "Remove retry_deactivation directive on lvremove" This reverts commit 3bc7ccdf95ef366d49a6c4e5924dde1327b1e9a6. Long shot, but only related change in Cinder since this started was this one. It's possible that the config specification on the cmd line does something "different". Let's find out. Change-Id: I61b05624ede4e86859789c332377c714925ef2e8 --- diff --git a/cinder/brick/local_dev/lvm.py b/cinder/brick/local_dev/lvm.py index b13d3d97d..4ec4a177e 100644 --- a/cinder/brick/local_dev/lvm.py +++ b/cinder/brick/local_dev/lvm.py @@ -644,9 +644,14 @@ class LVM(executor.Executor): root_helper=self._root_helper, run_as_root=True, check_exit_code=False) + # LV removal seems to be a race with other writers or udev in + # some cases (see LP #1270192), so we enable retry deactivation + LVM_CONFIG = 'activation { retry_deactivation = 1} ' + try: self._execute( 'lvremove', + '--config', LVM_CONFIG, '-f', '%s/%s' % (self.vg_name, name), root_helper=self._root_helper, run_as_root=True) @@ -663,14 +668,7 @@ class LVM(executor.Executor): # suspended devices; when lvmetad is not available, any # further lvm command will block forever. # Therefore we need to skip suspended devices on retry. - - # NOTE(jdg): This is one we don't want to set in the - # conf file, but only use when performing a recovery - # operation. In the future, I think a more reliable - # method for this may be to consult dmsetup for - # suspended devices and fix them up rather than ignoring - # them. - LVM_CONFIG = 'devices { ignore_suspended_devices = 1}' + LVM_CONFIG += 'devices { ignore_suspended_devices = 1}' self._execute( 'lvremove',