Skip to content

Commit

Permalink
Core & Internals: Fixes replica.py sqla20 regression rucio#6983
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingstaff authored and bari12 committed Jul 30, 2024
1 parent e892873 commit adfcf69
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/rucio/core/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -4046,21 +4046,16 @@ def get_suspicious_reason(rse_id, scope, name, nattempts=0, logger=logging.log,
bad_replicas_alias.name == name,
bad_replicas_alias.scope == scope,
bad_replicas_alias.state != 'S'))))
).subquery()
)

count_query = select(
func.count()
).select_from(
stmt
stmt.subquery()
)
count = session.execute(count_query).scalar_one()

grouped_stmt = select(
bad_replicas_alias.scope,
bad_replicas_alias.name,
bad_replicas_alias.reason,
bad_replicas_alias.rse_id
).group_by(
grouped_stmt = stmt.group_by(
bad_replicas_alias.rse_id,
bad_replicas_alias.scope,
bad_replicas_alias.name,
Expand Down

0 comments on commit adfcf69

Please sign in to comment.