File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1754,11 +1754,13 @@ def get_cluster_service_info(cluster: Dict[str, Any]) -> List[str]:
17541754 # the member dicts to find it
17551755 r = {'latest_end_lsn' : str , 'lag_to_primary' : int }
17561756 if 'members' in cluster :
1757- r = reduce (ior , cluster ['members' ], {})
1758- if 'latest_end_lsn' in r and 'lag_to_primary' in r :
1759- lag_to_primary = r .get ('lag_to_primary' )
1757+ for m in cluster ['members' ]:
1758+ if 'latest_end_lsn' in m and 'lag_to_primary' in m :
1759+ r .update (m )
1760+ if r ['latest_end_lsn' ] and r ['lag_to_primary' ]:
1761+ lag_to_primary = r ['lag_to_primary' ]
17601762 lag_to_primary = round (lag_to_primary / 1024 / 1024 ) if isinstance (lag_to_primary , int ) \
1761- else '' if lag_to_primary == 'unknown' else lag_to_primary
1763+ else lag_to_primary
17621764 if r ['latest_end_lsn' ] and lag_to_primary :
17631765 info = (f"The latest known LSN of the primary instance is { r ['latest_end_lsn' ]} , "
17641766 f"the replication lag is { lag_to_primary } MB" )
You can’t perform that action at this time.
0 commit comments