Common: Rewrite check_obsolete_replicas#145
Open
dchristidis wants to merge 1 commit intorucio:masterfrom
Open
Conversation
This was referenced Aug 5, 2024
Closed
2abaae4 to
2f9f1a2
Compare
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
2f9f1a2 to
c456b42
Compare
rdimaio
approved these changes
Aug 6, 2024
| free=None, issuer='root', files=files, | ||
| session=session) | ||
| except Exception: | ||
| print(traceback.format_exc()) |
There was a problem hiding this comment.
should there be a session.rollback() here?
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.