Backfill Escalation Statuses for Incident issues
What does this MR do and why?
This backfills Escalation Status records for Incident issues.
We enqueue a background migration worker that creates an IncidentManagment::IssuableEscalationStatus
record for each Incident issue, if it does not already exist.
These records are created with only the issue_id
set, as we cannot infer the other information such as policy_id
and escalations_started_at
.
Blocked by !75706 (merged) and !75176 (merged) (do not merge until those are both merged).
How to set up and validate locally
- Create a bunch of Incident typed Issues
- Run the migration
-
IncidentManagment::IssuableEscalationStatus
records should be created for each record.
gitlab.com:
Data to change in- num of incidents https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/7626/commands/27112
- num of escalation statuses that exist already https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/7626/commands/27113
- Total to add:
65,655
.
Query Plan
ModifyTable on public.incident_management_issuable_escalation_statuses (cost=2156.66..2250.31 rows=61 width=58) (actual time=690.049..690.052 rows=0 loops=1)
Buffers: shared hit=1278 read=1153 dirtied=33 written=2
I/O Timings: read=638.337 write=0.000
-> Bitmap Heap Scan on public.issues (cost=2156.66..2250.31 rows=61 width=58) (actual time=580.649..681.137 rows=139 loops=1)
Buffers: shared hit=149 read=1123 dirtied=9
I/O Timings: read=634.053 write=0.000
-> BitmapAnd (cost=2156.66..2156.66 rows=61 width=0) (actual time=577.884..577.886 rows=0 loops=1)
Buffers: shared hit=2 read=976
I/O Timings: read=533.815 write=0.000
-> Bitmap Index Scan using issues_pkey (cost=0.00..701.60 rows=48053 width=0) (actual time=49.678..49.678 rows=47812 loops=1)
Index Cond: ((issues.id >= 98900000) AND (issues.id <= 98950000))
Buffers: shared hit=2 read=248
I/O Timings: read=36.563 write=0.000
-> Bitmap Index Scan using index_issues_on_project_id_and_created_at_issue_type_incident (cost=0.00..1454.79 rows=71274 width=0) (actual time=525.317..525.317 rows=70840 loops=1)
Buffers: shared read=728
I/O Timings: read=497.252 write=0.000
Copy
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/7626/commands/27117
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #330281 (closed)
Edited by Sean Arnold