]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixes 3PAR FC driver synchronization
authorJim Branen <james.branen@hp.com>
Thu, 25 Apr 2013 00:52:41 +0000 (17:52 -0700)
committerJohn Griffith <john.griffith@solidfire.com>
Fri, 3 May 2013 21:54:51 +0000 (15:54 -0600)
While running  stress tests we found missing synchronized methods.
This patch added synchronized anotations around the necessary
methods.

Fixes bug 1172503

Change-Id: I8e475fe38d96ca663fbaac40c5a50420d791f5d5
(cherry picked from commit beacbd368124a656eaa4038fe1c35f1796e5dda4)

cinder/volume/drivers/san/hp/hp_3par_fc.py

index f469ef03f756248bb415c6ca522424a4e4dc1b22..6eb6a3527714de8c11e17ae11244960d71cf94f6 100644 (file)
@@ -116,6 +116,7 @@ must be the same" % (cpg['domain'], self.configuration.hp3par_domain)
         """Returns an error if prerequisites aren't met."""
         self._check_flags()
 
+    @lockutils.synchronized('3par-vol', 'cinder-', True)
     def create_volume(self, volume):
         metadata = self.common.create_volume(volume, self.client)
         return {'metadata': metadata}
@@ -125,9 +126,11 @@ must be the same" % (cpg['domain'], self.configuration.hp3par_domain)
                                                    self.client)
         return {'metadata': new_vol}
 
+    @lockutils.synchronized('3par-vol', 'cinder-', True)
     def delete_volume(self, volume):
         self.common.delete_volume(volume, self.client)
 
+    @lockutils.synchronized('3par-vol', 'cinder-', True)
     def create_volume_from_snapshot(self, volume, snapshot):
         """
         Creates a volume from a snapshot.
@@ -136,12 +139,15 @@ must be the same" % (cpg['domain'], self.configuration.hp3par_domain)
         """
         self.common.create_volume_from_snapshot(volume, snapshot, self.client)
 
+    @lockutils.synchronized('3par-snap', 'cinder-', True)
     def create_snapshot(self, snapshot):
         self.common.create_snapshot(snapshot, self.client)
 
+    @lockutils.synchronized('3par-snap', 'cinder-', True)
     def delete_snapshot(self, snapshot):
         self.common.delete_snapshot(snapshot, self.client)
 
+    @lockutils.synchronized('3par-attach', 'cinder-', True)
     def initialize_connection(self, volume, connector):
         """Assigns the volume to a server.
 
@@ -193,6 +199,7 @@ must be the same" % (cpg['domain'], self.configuration.hp3par_domain)
                          'target_wwn': ports['FC']}}
         return info
 
+    @lockutils.synchronized('3par-attach', 'cinder-', True)
     def terminate_connection(self, volume, connector, force):
         """
         Driver entry point to unattach a volume from an instance.
@@ -238,11 +245,14 @@ must be the same" % (cpg['domain'], self.configuration.hp3par_domain)
 
         return host
 
+    @lockutils.synchronized('3par-exp', 'cinder-', True)
     def create_export(self, context, volume):
         pass
 
+    @lockutils.synchronized('3par-exp', 'cinder-', True)
     def ensure_export(self, context, volume):
         pass
 
+    @lockutils.synchronized('3par-exp', 'cinder-', True)
     def remove_export(self, context, volume):
         pass