Reaper crashes when it tries to delete a DIDs that is a constituent of an archive
Motivation
----------
Reaper crashes when it tries to delete a DIDs that is a constituent of an archive






diff --git a/lib/rucio/core/replica.py b/lib/rucio/core/replica.py
index d109033c1..7aa88a723 100644
--- a/lib/rucio/core/replica.py
+++ b/lib/rucio/core/replica.py
@@ -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'],
['lib/rucio/core/replica.py']