Skip to content

Commit

Permalink
fix(inputs.sqlserver): set lower deadlock priority (#11522)
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalovagabond authored Jul 19, 2022
1 parent cb0df01 commit ae695e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/inputs/sqlserver/sqlqueriesV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,9 @@ ELSE
`

const sqlServerRequestsV2 string = `
SET DEADLOCK_PRIORITY -10;
SET NOCOUNT ON;
DECLARE
@SqlStatement AS nvarchar(max)
,@EngineEdition AS tinyint = CAST(SERVERPROPERTY('EngineEdition') AS int)
Expand Down Expand Up @@ -1324,6 +1326,8 @@ EXEC sp_executesql @SqlStatement
`

const sqlServerVolumeSpaceV2 string = `
SET DEADLOCK_PRIORITY -10;
/* Only for on-prem version of SQL Server
Gets data about disk space, only for volumes used by SQL Server (data available form sql 2008R2 and later)
*/
Expand All @@ -1349,6 +1353,8 @@ IF @EngineEdition IN (2,3,4) AND @MajorMinorVersion >= 1050
`

const sqlServerCPUV2 string = `
SET DEADLOCK_PRIORITY -10;
/*The ring buffer has a new value every minute*/
IF SERVERPROPERTY('EngineEdition') IN (2,3,4) /*Standard,Enterpris,Express*/
BEGIN
Expand Down

0 comments on commit ae695e8

Please sign in to comment.