Blocking DMV collector: layered wait thresholds + RESOURCE_SEMAPHORE; guard slicer/drill-down vs missing table#1235
Merged
Conversation
… guard slicer/drill-down vs missing table Collector (install/56 + Lite RemoteCollectorService.DmvBlockingSnapshot.cs): - Add RESOURCE_SEMAPHORE% (covers RESOURCE_SEMAPHORE and RESOURCE_SEMAPHORE_QUERY_COMPILE) to the edge scope. Verified live that these waits DO carry blocking_session_id (the grant holders), so they form real blocker->blocked edges and pass the existing filter. - Layered minimum-wait floor to cut grid/chain noise by contention class: LCK 2s, PAGELATCH 0.5s, PAGEIOLATCH 1s, RESOURCE_SEMAPHORE(+_QUERY_COMPILE) 5s. Schema (install/02 + install/06): - Widen collect.dmv_blocking_snapshots.lock_mode nvarchar(20) -> nvarchar(64) so the RESOURCE_SEMAPHORE_QUERY_COMPILE tag (32 chars) fits whole. Lite DuckDB VARCHAR unbounded. Guard (regression fix): - New BlockingPairRowQuery.DmvSnapshotsTableExistsAsync probe. The slicer (DatabaseService.QueryPerformance.cs) and flat drill-down (SqlServerDrillDownCollector.Blocking.cs) inline the DMV table in a single combined CTE/UNION, which fails to COMPILE (Msg 208) on a not-yet-upgraded server -- a runtime catch can't rescue one batch. They now drop the DMV branch when the table is absent, degrading to BPR-only instead of blanking the slicer / erroring the drill-down. Both apps build clean; Dashboard 652 / Lite 578 / Installer 80 tests pass; install/56 PARSEONLY-clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to the always-on DMV blocking fallback (#1227/#1230/#1233/#1234). Two things:
1. Layered wait-type thresholds + RESOURCE_SEMAPHORE (collector, both apps)
Added
RESOURCE_SEMAPHORE%to the edge scope (covers bothRESOURCE_SEMAPHOREandRESOURCE_SEMAPHORE_QUERY_COMPILE). Confirmed live that these waits do carryblocking_session_id(the memory-grant holders) -- they form real blocker->blocked edges, including the many-to-many case where one memory waiter is reported blocked by every current grant holder.Layered minimum-wait floor to cut grid/chain noise by contention class:
THREADPOOL deliberately excluded -- no
blocking_session_id, and unobservable during real worker starvation.2. Guard the slicer + flat drill-down against a missing DMV table (regression fix)
The slicer (
DatabaseService.QueryPerformance.cs) and flat drill-down (SqlServerDrillDownCollector.Blocking.cs) inlinecollect.dmv_blocking_snapshotsin a single combined CTE/UNION, which fails to compile (Msg 208) on a not-yet-upgraded server -- so the slicer blanked and the drill-down errored. A runtimetry/catchcan't rescue a single combined batch (unlike the already-guarded pair-row + grid paths, which fetch DMV separately). NewBlockingPairRowQuery.DmvSnapshotsTableExistsAsyncprobe lets both surfaces drop the DMV branch entirely when the table is absent, degrading to BPR-only.Schema
collect.dmv_blocking_snapshots.lock_modewidenednvarchar(20)->nvarchar(64)(install/02+install/06) so theRESOURCE_SEMAPHORE_QUERY_COMPILEtag (32 chars) fits whole. Lite's DuckDBVARCHARis unbounded (no change).Testing
install/56PARSEONLY-clean.Not in this PR (held)
CollectBlockingChainFactsAsyncload-error (capture the real exception, not a blind timeout bump).🤖 Generated with Claude Code