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 <viroel@gmail.com>
This commit is contained in:
Douglas Viroel 2020-10-07 16:33:58 -03:00
parent 52c926e32c
commit 2e27c71877
2 changed files with 10 additions and 2 deletions

View File

@ -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'])

View File

@ -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 <https://bugs.launchpad.net/manila/+bug/1898924>`_
for more details.