]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove retry_deactivation directive on lvremove
authorJohn Griffith <john.griffith@solidfire.com>
Thu, 19 Feb 2015 23:18:12 +0000 (16:18 -0700)
committerJohn Griffith <john.griffith@solidfire.com>
Thu, 19 Feb 2015 23:18:12 +0000 (16:18 -0700)
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

cinder/brick/local_dev/lvm.py

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