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

sp_BlitzLock in Azure SQLMI not working due to Azure changes #3392

Closed
FatimaBrunson opened this issue Nov 8, 2023 · 3 comments · Fixed by #3397
Closed

sp_BlitzLock in Azure SQLMI not working due to Azure changes #3392

FatimaBrunson opened this issue Nov 8, 2023 · 3 comments · Fixed by #3397

Comments

@FatimaBrunson
Copy link

Version of the script
Look in the stored procedure, and it'll have a version date & number near the top. Put that in here. If it's not the current version (dated in the last month), then upgrade to the current version and test that before reporting a bug - we fix a lot of stuff in each new build. We'll flat out close bug reports for older builds.
--Version = '8.17', VersionDate = '20231010';

What is the current behavior?
-- Script is erroring out and giving the below error message
image

If the current behavior is a bug, please provide the steps to reproduce.
-- Opened a New Query window in my Azure SQLMI. Executed "sp_BlitzLock" and "sp_BlitzLock @DatabaseName = [NameOfDB]". Below is the error that came from running both scripts

What is the expected behavior?
--This script checks for and analyzes deadlocks from the system health session or a custom extended event path

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
--Azure Managed Instance. OS: Server 2022 version 10.0. I've also tried to run the sp_BlitzLock in OS Server 2019 Azure SQLMI with no luck. I've ran the sp_BlitzLock in a SQLExpress server and that worked just fine.

@BrentOzar
Copy link
Member

It looks like it's related to this: https://techcommunity.microsoft.com/t5/azure-sql-blog/improving-extended-events-in-azure-sql/ba-p/3980918

Microsoft "improved" Extended Events for Managed Instances without telling anyone until AFTER the changes were already made. Classic Azure stuff.

I don't have a Managed Instance up and running, and it'll cost me money to light one up. I'm going to leave this open so that if someone has an MI, and they want to help volunteer to troubleshoot the code, they can. Or, Fatima, if you'd like to troubleshoot it, you're welcome to - I just can't provide any assistance here when Microsoft makes these kinds of changes on the fly.

@BrentOzar BrentOzar changed the title sp_BlitzLock in Azure SQLMI not working sp_BlitzLock in Azure SQLMI not working due to Azure changes Nov 14, 2023
@erikdarlingdata
Copy link
Contributor

@FatimaBrunson This isn't new or unexpected. When you use MI, you need to hit the ring buffer portion of the system health extended event session:

EXEC dbo.sp_BlitzLock @TargetSessionType = 'ring'

I do think that sp_BlitzLock should make that clear either in the help section or raising a custom error with an example execution to get it working in MI. I'll work on things to that end. This has come up a few times now.

@erikdarlingdata erikdarlingdata self-assigned this Nov 19, 2023
erikdarlingdata added a commit to erikdarlingdata/SQL-Server-First-Responder-Kit that referenced this issue Nov 20, 2023
This pull request looks a little funny, because when I re-synced my fork, the available plans query was all beat up for some reason, and I had to paste in the version from the current master branch.

Anyway, the two actual changes in this PR:
 * Closes BrentOzarULTD#3385
 * Closes BrentOzarULTD#3392

Since I can't repro BrentOzarULTD#3385, I'm making the smallest change possible that fixes the issue with mocked-up test data. It will need some community testing to validate.

For BrentOzarULTD#3392 I added a local variable to detect MI, and then set the TargetSessionType to ring_buffer if it's NULL, and we're looking at the system_health extended event. It might be a good idea to have this happen for any session on MI, but I'm going to keep it limited at first.
@BrentOzar BrentOzar added this to the 2023-12 Release milestone Dec 14, 2023
@BrentOzar
Copy link
Member

Looks good! Thanks for the pull request. Merging into the dev branch, will be in the next release with credit to you in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants