fix(alert): Delete IncidentTrigger as child of AlertRuleTrigger#101460
fix(alert): Delete IncidentTrigger as child of AlertRuleTrigger#101460
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #101460 +/- ##
========================================
Coverage 81.02% 81.02%
========================================
Files 8701 8701
Lines 386021 386019 -2
Branches 24409 24409
========================================
+ Hits 312774 312778 +4
+ Misses 72896 72890 -6
Partials 351 351 |
|
I wonder if we instead change the order here https://github.com/getsentry/sentry/blob/master/src/sentry/deletions/defaults/alertrule.py#L15 to have |
I think it would, but we'd probably still not want to rely on cascades, and I think we don't index IncidentTrigger by incident id, so that path would likely be pretty slow. |
It is indexed https://github.com/getsentry/sentry/blob/master/src/sentry/incidents/models/incident.py#L322 but I'm ok with trying it on the |
There can be 10s-100s of thousands of IncidentTrigger rows associated with an AlertRuleTrigger.
In SENTRY-4A76, we see repeated failed attempts to delete an AlertRuleTrigger with 15k IncidentTriggers, and this change will hopefully help there.