Skip to content

Commit

Permalink
Merge pull request #2708 from cserf/patch-2707-Reaper_crashes_when_it…
Browse files Browse the repository at this point in the history
…_tries_to_delete_a_DIDs_that_is_a_constituent_of_an_archive

Reaper crashes when it tries to delete a DIDs that is a constituent of an archive : Closes #2707
  • Loading branch information
bari12 committed Jul 4, 2019
2 parents 42d937c + 38c90a3 commit 707ef41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rucio/core/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,9 @@ def delete_replicas(rse, files, ignore_availability=True, session=None):
~exists(select([1]).prefix_with("/*+ INDEX(REPLICAS REPLICAS_PK) */", dialect='oracle')).where(and_(models.RSEFileAssociation.scope == file['scope'], models.RSEFileAssociation.name == file['name']))))

did_condition.append(and_(models.DataIdentifier.scope == file['scope'], models.DataIdentifier.name == file['name'], models.DataIdentifier.availability != DIDAvailability.LOST,
~exists(select([1]).prefix_with("/*+ INDEX(REPLICAS REPLICAS_PK) */", dialect='oracle')).where(and_(models.RSEFileAssociation.scope == file['scope'], models.RSEFileAssociation.name == file['name']))))
~exists(select([1]).prefix_with("/*+ INDEX(REPLICAS REPLICAS_PK) */", dialect='oracle')).where(and_(models.RSEFileAssociation.scope == file['scope'], models.RSEFileAssociation.name == file['name'])),
~exists(select([1]).prefix_with("/*+ INDEX(ARCHIVE_CONTENTS ARCH_CONTENTS_PK) */", dialect='oracle')).where(and_(models.ConstituentAssociation.child_scope == file['scope'],
models.ConstituentAssociation.child_name == file['name']))))

archive_contents_condition.append(and_(models.ConstituentAssociation.scope == file['scope'],
models.ConstituentAssociation.name == file['name'],
Expand Down

0 comments on commit 707ef41

Please sign in to comment.