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

Common: Rewrite check_obsolete_replicas #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dchristidis
Copy link
Contributor

This is related to both #109 and #127. The functionality remains the same but it creates opportunities to augment it in the future (e.g. write the results to standard output or store them also in Prometheus).

Performance appears to be equivalent (or even better) compared to the original implementation. Once approved and merged (ATLAS is currently validating it in production), I will do the same for check_expired_replicas.

This is a complete rewrite that still maintains the exact same
functionality. Instead of one large ATLAS-specific PL/SQL script, this
implementation:

 1. Uses the gateway layer to list the RSEs and to update the RSE usage
    counters
 2. Works on each RSE separately
 3. Uses SQLAlchemy 2.0 syntax
 4. Replaces the deprecated function-based `REPLICAS_TOMBSTONE_IDX`
    index
@dchristidis dchristidis force-pushed the rewrite-check_obsolete_replicas branch from 2f9f1a2 to c456b42 Compare August 5, 2024 14:55
free=None, issuer='root', files=files,
session=session)
except Exception:
print(traceback.format_exc())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a session.rollback() here?

Copy link
Contributor Author

@dchristidis dchristidis Aug 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More importantly, I’m missing a session.commit(), so many thanks for your comment.

But I’m not yet convinced what I’m doing here is a good idea. If we didn’t have a custom query, we wouldn’t try to tie the gateway calls to a particular session. Is there a benefit to ensuring either all of the RSE usage counters are updated or none at all? I’m not sure. My initial motivation was to be able to add a dry-run mode easily, but this may not be the best way to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants