Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deletion: disable contents_pk index on parent retrieval. Closes #5097 #5100

Merged
merged 1 commit into from
Dec 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 13 additions & 5 deletions lib/rucio/core/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,11 +1738,19 @@ def __cleanup_after_replica_deletion(rse_id, files, session=None):
child_did_condition, tmp_parent_condition = [], []
for chunk in chunks(parent_condition, 10):

query = session.query(models.DataIdentifierAssociation.scope, models.DataIdentifierAssociation.name,
models.DataIdentifierAssociation.did_type,
models.DataIdentifierAssociation.child_scope, models.DataIdentifierAssociation.child_name).\
filter(or_(*chunk))
for parent_scope, parent_name, did_type, child_scope, child_name in query:
stmt = select(
models.DataIdentifierAssociation.scope,
models.DataIdentifierAssociation.name,
models.DataIdentifierAssociation.did_type,
models.DataIdentifierAssociation.child_scope,
models.DataIdentifierAssociation.child_name,
).prefix_with(
"/*+ NO_INDEX_FFS(CONTENTS CONTENTS_PK) */",
dialect='oracle',
).where(
or_(*chunk)
)
for parent_scope, parent_name, did_type, child_scope, child_name in session.execute(stmt):

# Schedule removal of child file/dataset/container from the parent dataset/container
child_did_condition.append(
Expand Down