Skip to content

Say that a parallel request can add more than one tempdb limit violation - #10466

Open
Rudi Bruchez (rudi-bruchez) wants to merge 1 commit into
MicrosoftDocs:livefrom
rudi-bruchez:fix/tempdb-limit-violation-count
Open

Rudi Bruchez (rudi-bruchez) wants to merge 1 commit into
MicrosoftDocs:livefrom
rudi-bruchez:fix/tempdb-limit-violation-count

Conversation

@rudi-bruchez

Copy link
Copy Markdown
Contributor

What's wrong

tempdb-space-resource-governance.md says that when a request is aborted with error 1138, total_tempdb_data_limit_violation_count "is incremented by one", and sys-dm-resource-governor-workload-groups-transact-sql.md describes the column as "The number of times a request was aborted with error 1138". For a parallel request, one error 1138 can add more than one to the column: it grew by 2 at MAXDOP 2, by 3 or 4 at MAXDOP 4, and by 1 at MAXDOP 1. Someone who reads the column as a number of aborted requests overcounts them.

Evidence

SQL Server 2025 CU7 (17.0.4065.4) and CU10 (17.0.5035.5), Enterprise Developer, Linux containers, 4 processors. Resource governor with no classifier, connected as sa (workload group default).

ALTER WORKLOAD GROUP [default] WITH (GROUP_MAX_TEMPDB_DATA_MB = 64);
ALTER RESOURCE GOVERNOR RECONFIGURE;
GO
SELECT 'before' AS step, total_tempdb_data_limit_violation_count AS violations
FROM sys.dm_resource_governor_workload_groups WHERE name = N'default';
GO
SELECT CAST(value AS int) AS n, CAST('x' AS char(100)) AS pad
INTO #t1 FROM GENERATE_SERIES(1, 3000000) OPTION (MAXDOP 1);
GO
SELECT 'after MAXDOP 1' AS step, total_tempdb_data_limit_violation_count AS violations
FROM sys.dm_resource_governor_workload_groups WHERE name = N'default';
GO
SELECT CAST(value AS int) AS n, CAST('x' AS char(100)) AS pad
INTO #t2 FROM GENERATE_SERIES(1, 3000000) OPTION (MAXDOP 2);
GO
SELECT 'after MAXDOP 2' AS step, total_tempdb_data_limit_violation_count AS violations
FROM sys.dm_resource_governor_workload_groups WHERE name = N'default';
GO
SELECT CAST(value AS int) AS n, CAST('x' AS char(100)) AS pad
INTO #t4 FROM GENERATE_SERIES(1, 3000000) OPTION (MAXDOP 4);
GO
SELECT 'after MAXDOP 4' AS step, total_tempdb_data_limit_violation_count AS violations
FROM sys.dm_resource_governor_workload_groups WHERE name = N'default';

Each SELECT ... INTO fails once with error 1138. Observed, the same on both builds:

step            violations
before          0
after MAXDOP 1  1
after MAXDOP 2  3
after MAXDOP 4  7

Expected per the current text: 0, 1, 2, 3. Seven more runs on CU7, one error each: MAXDOP 4 added 4, 4, 3 and 4, MAXDOP 1 added 1 each time. In one MAXDOP 4 run that added 3, a session on tempdb_data_workload_group_limit_reached recorded 3 events.

Change

In the governance page, says that the column can increase by more than one for a parallel request. In the DMV page, describes the column as the number of recorded tempdb data limit violations for the workload group. The sentence about the extended event is unchanged.

@prmerger-automator

Copy link
Copy Markdown
Contributor

Rudi Bruchez (@rudi-bruchez) : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@prmerger-automator

Copy link
Copy Markdown
Contributor

Rudi Bruchez (@rudi-bruchez) : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit e26503b:

✅ Validation status: passed

File Status Preview URL Details
docs/relational-databases/resource-governor/tempdb-space-resource-governance.md ✅Succeeded
docs/relational-databases/system-dynamic-management-objects/sys-dm-resource-governor-workload-groups-transact-sql.md ✅Succeeded

For more details, please refer to the build report.

```

When a request is aborted with error 1138, the value in the `total_tempdb_data_limit_violation_count` column of the [sys.dm_resource_governor_workload_groups](../system-dynamic-management-objects/sys-dm-resource-governor-workload-groups-transact-sql.md) dynamic management view (DMV) is incremented by one, and the `tempdb_data_workload_group_limit_reached` extended event fires.
When a request is aborted with error 1138, the value in the `total_tempdb_data_limit_violation_count` column of the [sys.dm_resource_governor_workload_groups](../system-dynamic-management-objects/sys-dm-resource-governor-workload-groups-transact-sql.md) dynamic management view (DMV) can increase by more than one for a parallel request, and the `tempdb_data_workload_group_limit_reached` extended event fires.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rudi Bruchez (@rudi-bruchez) we are holding on this change while we investigate the actual and intended product behavior.

@v-dirichards

Copy link
Copy Markdown
Contributor

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator Bot added the aq-pr-triaged tracking label for the PR review team label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants