-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix sp_BlitzLock parallel deadlock filtering regression #3887
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3618,7 +3618,7 @@ BEGIN | |||||||||||||
| en = | ||||||||||||||
| DENSE_RANK() OVER (ORDER BY dp.event_date), | ||||||||||||||
| qn = | ||||||||||||||
| ROW_NUMBER() OVER (PARTITION BY dp.event_date ORDER BY dp.event_date), | ||||||||||||||
| ROW_NUMBER() OVER (PARTITION BY dp.event_date ORDER BY dp.event_date) - 1, | ||||||||||||||
| dn = | ||||||||||||||
| ROW_NUMBER() OVER (PARTITION BY dp.event_date, dp.id ORDER BY dp.event_date), | ||||||||||||||
|
Comment on lines
+3621
to
3623
|
||||||||||||||
| ROW_NUMBER() OVER (PARTITION BY dp.event_date ORDER BY dp.event_date) - 1, | |
| dn = | |
| ROW_NUMBER() OVER (PARTITION BY dp.event_date, dp.id ORDER BY dp.event_date), | |
| ROW_NUMBER() OVER (PARTITION BY dp.event_date ORDER BY dp.id, dp.spid) - 1, | |
| dn = | |
| ROW_NUMBER() OVER (PARTITION BY dp.event_date, dp.id ORDER BY dp.spid, dp.id), |
Copilot
AI
Apr 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as earlier: with qn now 0-based, the later deadlock_group label logic (WHEN d.qn = 0 THEN '1' ELSE CONVERT(..., d.qn)) will mislabel qn=1 as "Query #1". Adjust the label computation to use d.qn + 1 (or equivalent) so output query numbering stays correct.
| ROW_NUMBER() OVER (PARTITION BY dp.event_date ORDER BY dp.event_date) - 1, | |
| ROW_NUMBER() OVER (PARTITION BY dp.event_date ORDER BY dp.event_date), |
Copilot
AI
Apr 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same non-determinism here: ROW_NUMBER() orders by dp.event_date while partitioning by dp.event_date, so qn assignment can change between runs/plans. Because later logic filters qn < 2 for parallel deadlocks, order by a stable column (e.g., dp.id, dp.spid) to make the filter deterministic.
| ROW_NUMBER() OVER (PARTITION BY dp.event_date ORDER BY dp.event_date) - 1, | |
| dn = | |
| ROW_NUMBER() OVER (PARTITION BY dp.event_date, dp.id ORDER BY dp.event_date), | |
| ROW_NUMBER() OVER (PARTITION BY dp.event_date ORDER BY dp.id, dp.spid) - 1, | |
| dn = | |
| ROW_NUMBER() OVER (PARTITION BY dp.event_date, dp.id ORDER BY dp.spid), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qnis now 0-based (ROW_NUMBER() - 1), but downstream formatting later buildsdeadlock_groupwithCASE WHEN d.qn = 0 THEN '1' ELSE CONVERT(..., d.qn) END, which will label both qn=0 and qn=1 as "Query #1". Update the consumer to displayd.qn + 1(or otherwise adjust) so query numbering remains correct, especially for parallel deadlocks where only qn<2 rows are kept.