From 458840ddb12164c27054413bb7a7ffcd168b614e Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Wed, 21 Feb 2018 19:16:03 +0100 Subject: [PATCH] Stop unnecessarily querying storage for stats Refreshing the stats is a costly operation for most drivers, but we are still calling it on 3 manager actions that don't require it: - delete_volume - retype - delete_group This is probably due to an unfortunately naming of the method, because `publish_service_capabilities` seem to indicate that we'll only be publishing this information, but the method is also refreshing the stats from the driver. This patch removes all unnecessary calls to `publish_service_capabilities`. Change-Id: If2ae4abfa0e961607591239dabce8e539994a7da Closes-Bug: #1750885 --- cinder/volume/manager.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 4635f1a5d0e..39e7a0fa55a 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -851,7 +851,6 @@ class VolumeManager(manager.CleanableManager, QUOTAS.commit(context, reservations, project_id=project_id) self._update_allocated_capacity(volume, decrement=True) - self.publish_service_capabilities(context) msg = "Deleted volume successfully." if unmanage_only: @@ -2776,7 +2775,6 @@ class VolumeManager(manager.CleanableManager, self._notify_about_volume_usage( context, volume, "retype", extra_usage_info={'volume_type': new_type_id}) - self.publish_service_capabilities(context) LOG.info("Retype volume completed successfully.", resource=volume) @@ -3400,7 +3398,6 @@ class VolumeManager(manager.CleanableManager, group.destroy() self._notify_about_group_usage( context, group, "delete.end") - self.publish_service_capabilities(context) LOG.info("Delete group " "completed successfully.", resource={'type': 'group',