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

OSIDB-3579: Implement alert versioning to reduce database locks #856

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

MrMarble
Copy link
Member

@MrMarble MrMarble commented Dec 10, 2024

  • Added new field last_validated_dt to the AlertMixin and created_dt to the Alert Model.
  • Remove the alerts.all.delete() method call to prevent database locks
  • Modify the AlertSerializer to filter out alerts with a created_dt older than the last_validated_dt of the object they are related
  • Created a stale_alert_cleanup celery task to run periodically

Closes OSIDB-3579

@MrMarble MrMarble self-assigned this Dec 10, 2024
@MrMarble MrMarble marked this pull request as ready for review December 10, 2024 15:21
@MrMarble MrMarble requested a review from a team December 10, 2024 15:21
Copy link
Contributor

@costaconrado costaconrado left a comment

Choose a reason for hiding this comment

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

This PR looks mostly good to me, I just requested a change about the collector because I strongly believe it will take more than 1 hour to this collector do finish, but overall, good job!

@MrMarble MrMarble force-pushed the OSIDB-3579 branch 4 times, most recently from eb3756c to 985bb5e Compare December 11, 2024 12:29
Copy link
Contributor

@costaconrado costaconrado left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@MrMarble MrMarble changed the title OSIDB-3579: Implment alert versioning to reduce database locks OSIDB-3579: Implement alert versioning to reduce database locks Dec 11, 2024
Copy link
Contributor

@JakubFrejlach JakubFrejlach left a comment

Choose a reason for hiding this comment

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

Couple of remarks, but otherwise LGTM! Really great job. I like the query creativity.

@MrMarble MrMarble force-pushed the OSIDB-3579 branch 3 times, most recently from 25f3bf4 to 5c36029 Compare December 11, 2024 14:42
Copy link
Contributor

@osoukup osoukup left a comment

Choose a reason for hiding this comment

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

This change is great! Most of it LGTM. I have some complains I think should be addressed regarding the location of the module and that it uses the collector framework.

@MrMarble MrMarble force-pushed the OSIDB-3579 branch 2 times, most recently from 47272c4 to bf09b76 Compare December 12, 2024 08:35
@MrMarble MrMarble added the technical For PRs that introduce changes not worthy of a CHANGELOG entry label Dec 12, 2024
@MrMarble MrMarble requested a review from osoukup December 12, 2024 08:36
Copy link
Contributor

@osoukup osoukup left a comment

Choose a reason for hiding this comment

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

This is almost perfect! But 😄 I would like to fix and maybe even remove (or please explain the purpose) the autoretry_for

Copy link
Contributor

@osoukup osoukup left a comment

Choose a reason for hiding this comment

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

LGTM. Great work! Many thanks for addressing my feedback!

@MrMarble MrMarble added this pull request to the merge queue Dec 12, 2024
Merged via the queue into master with commit 1270689 Dec 12, 2024
11 checks passed
@MrMarble MrMarble deleted the OSIDB-3579 branch December 12, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical For PRs that introduce changes not worthy of a CHANGELOG entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants