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

fix(inputs.sqlserver): fixing wrong filtering for sqlAzureMIRequests and sqlAzureDBRequests #11701

Merged
merged 2 commits into from
Aug 22, 2022

Conversation

deweter
Copy link
Contributor

@deweter deweter commented Aug 18, 2022

PR #10553 for an issue #10741 introduced a wrong filtering which leads to the state that all sessions are shown in the output - disregarding if they are running requests or not.

The filtering condition:
[request_id] IS NOT NULL --A request must exists
couldn't be ever true as in the previous code the [request_id] has been already changed to NonNullable inside the inner query:
NULLIF(r.[blocking_session_id],0) AS [blocking_session_id]

@telegraf-tiger telegraf-tiger bot added area/sqlserver fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Aug 18, 2022
@powersj
Copy link
Contributor

powersj commented Aug 18, 2022

@Trovalo thoughts?

@deweter
Copy link
Contributor Author

deweter commented Aug 18, 2022

Just adding that this is a sample of the fixed output:
image

Only sessions which have a requests are shown (plus blocker SPIDs if present)

At this moment - before this fix - all sessions are shown - even when they have no request at all:
image

@Trovalo
Copy link
Collaborator

Trovalo commented Aug 18, 2022

I'll have a look at it soon

@Trovalo
Copy link
Collaborator

Trovalo commented Aug 18, 2022

@deweter thanks for noticing the issue, It's definitely an error that slipped through.
The very same issue is also valid for AzureSqlDb, (ref), can you apply the same fix in that query?

The issue is not present for SQL Server on-prem.

@deweter deweter force-pushed the fix/input/sqlserver branch from 4f9a7ba to 9b570ec Compare August 19, 2022 11:07
@deweter deweter changed the title fix(inputs.sqlserver): fixing wrong filtering for sqlAzureMIRequests fix(inputs.sqlserver): fixing wrong filtering for sqlAzureMIRequests and sqlAzureDBRequests Aug 19, 2022
@Trovalo
Copy link
Collaborator

Trovalo commented Aug 19, 2022

Thanks,@deweter.

@powersj can you approve/merge this?

Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you both for the PR and the review!

@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sqlserver fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants