Skip to content

Commit

Permalink
Don't run periodic_share_replica_update() on active replicas
Browse files Browse the repository at this point in the history
Similar to periodic_share_replica_snapshot_update() skip active
replicas and do what the comment above says.

Change-Id: I719c670416c06f8eb9228a3537034285ae3733b4
Closes-Bug: #1924230
  • Loading branch information
Carthaca committed Apr 16, 2021
1 parent e1dd8d5 commit eb88087
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manila/share/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2595,7 +2595,8 @@ def periodic_share_replica_update(self, context):
# Filter only non-active replicas belonging to this backend
def qualified_replica(r):
return (share_utils.extract_host(r['host']) ==
share_utils.extract_host(self.host))
share_utils.extract_host(self.host) and
r['replica_state'] != constants.REPLICA_STATE_ACTIVE)

replicas = list(filter(lambda x: qualified_replica(x), replicas))
for replica in replicas:
Expand Down

0 comments on commit eb88087

Please sign in to comment.