]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Revert "Remove retry_deactivation directive on lvremove"
authorJohn Griffith <john.griffith8@gmail.com>
Wed, 25 Feb 2015 05:53:26 +0000 (05:53 +0000)
committerJohn Griffith <john.griffith8@gmail.com>
Wed, 25 Feb 2015 05:53:26 +0000 (05:53 +0000)
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

cinder/brick/local_dev/lvm.py

index b13d3d97d8deeb6da1b5067788cd87193186026d..4ec4a177e8fee833d13d78e46d249abdd57b9313 100644 (file)
@@ -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',