commit 2e27c71877fdb601ba90b44c3573d8e50e099042 Author: Douglas Viroel Date: Wed Oct 7 16:33:58 2020 -0300 Fix 'update_share_replica' doesn't provide share server model to drivers This patch fixes the 'update_share_replica' operation in the share manager that wasn't getting the share-server model from the share replica model. When the operation is executed, the current share replica object may not have the 'share-server-id' information and need to be updated before anything else. Closes-Bug: #1898924 Change-Id: I1d9d69bbdaa27a68a425d959fa8c5da83a157548 Signed-off-by: Douglas Viroel diff --git a/manila/share/manager.py b/manila/share/manager.py index acf78d8..aee2dbc 100644 --- a/manila/share/manager.py +++ b/manila/share/manager.py @@ -2455,8 +2455,6 @@ class ShareManager(manager.SchedulerDependentManager): @locked_share_replica_operation def _share_replica_update(self, context, share_replica, share_id=None): - share_server = self._get_share_server(context, share_replica) - # Re-grab the replica: try: share_replica = self.db.share_replica_get( @@ -2473,6 +2471,8 @@ class ShareManager(manager.SchedulerDependentManager): constants.REPLICA_STATE_ACTIVE): return + share_server = self._get_share_server(context, share_replica) + access_rules = self.db.share_access_get_all_for_share( context, share_replica['share_id']) diff --git a/releasenotes/notes/bug-1898924-fix-share-replica-update-missing-share-server-model-c1c060a7c06e4512.yaml b/releasenotes/notes/bug-1898924-fix-share-replica-update-missing-share-server-model-c1c060a7c06e4512.yaml new file mode 100644 index 0000000..11f96fc --- /dev/null +++ b/releasenotes/notes/bug-1898924-fix-share-replica-update-missing-share-server-model-c1c060a7c06e4512.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Fixed an issue that can lead a share replica to fail during the status + update operation, due to a concurrency between `share replica create` and + `shara replica update` operations. Refer to + `Launchpad Bug #1898924 `_ + for more details. \ No newline at end of file