From: John Griffith Date: Thu, 19 Feb 2015 23:18:12 +0000 (-0700) Subject: Remove retry_deactivation directive on lvremove X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3bc7ccdf95ef366d49a6c4e5924dde1327b1e9a6;p=openstack-build%2Fcinder-build.git Remove retry_deactivation directive on lvremove A while back an LVM_CONF directive was added to explicitly retry_deactivation on lvremove. This was a great idea, but since then the LVM defaults all seem to set this for us anyway so we don't really need to send it in the call explicitly any more. Also, we've introduced the option to use a cinder specific lvm.conf file which can be used to set or unset values like this going forward: (commit: eb7bb3e08c1b8e1008ba447b842b635821e2097e) This patch removes the retry_deactivation directive, but leaves the ignore_suspended_devices setting as we don't want to use that all the time, but only during recovery. There may be better options for this call as well but that's a possible future improvement unrelated to this commit. Change-Id: I167ea9a24cfeeb3716c90c87a0609271d3255ca6 --- diff --git a/cinder/brick/local_dev/lvm.py b/cinder/brick/local_dev/lvm.py index 4ec4a177e..b13d3d97d 100644 --- a/cinder/brick/local_dev/lvm.py +++ b/cinder/brick/local_dev/lvm.py @@ -644,14 +644,9 @@ 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) @@ -668,7 +663,14 @@ 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. - LVM_CONFIG += 'devices { ignore_suspended_devices = 1}' + + # 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}' self._execute( 'lvremove',