diff --git a/manila/share/manager.py b/manila/share/manager.py index ac60e5dee8..27cbcc7086 100644 --- a/manila/share/manager.py +++ b/manila/share/manager.py @@ -2445,7 +2445,8 @@ class ShareManager(manager.SchedulerDependentManager): # 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: diff --git a/releasenotes/notes/bug-1924230-skip-periodic-task-for-active-replica-030a982af92f8a62.yaml b/releasenotes/notes/bug-1924230-skip-periodic-task-for-active-replica-030a982af92f8a62.yaml new file mode 100644 index 0000000000..18d3b68280 --- /dev/null +++ b/releasenotes/notes/bug-1924230-skip-periodic-task-for-active-replica-030a982af92f8a62.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - Fixed periodic_share_replica_update() to skip active replicas similarly to + periodic_share_replica_snapshot_update(). The intention is to check on + non-active replicas, that can be 'in_sync', 'out_of_sync' or in 'error' + state.