Skip to content

Darling blocking anomaly baseline still counts self-waits after #6663 #6690

Closed

Description

@erikdarlingdata

Claude posting for Erik Darling.

Problem

#6663 drops self-waits (a blocked process report whose blocked and blocking spid are the same, non-zero session) from every blocking read, including the current window of Darling's blocking anomaly check (PgAnomalyDetector). The baseline that window is compared with still counts them. collect.blocked_process_baseline is a continuous aggregate built by TimescaleSupport.CreateBlockedProcessBaselineSql (Darling/PerformanceMonitor.Darling.Storage/TimescaleSupport.cs ~803) as count(*) AS event_count FROM collect.blocked_process_reports, with no self-wait filter.

On a server whose reports include self-waits, the current count is filtered and the baseline is not, so the ratio reads low and a real blocking rise can stay under the anomaly line. Lite's baseline is a query, and #6663 already filters it, so Lite and Darling disagree on the same data.

Fix

A store migration that recreates collect.blocked_process_baseline with the same predicate as BlockingWaits.NotSelfWaitSql and refreshes it over its retention, and the same filter on the plain-PostgreSQL path if it builds the baseline without TimescaleDB. It needs a migration number, so it waits for its turn in the migration queue, after #6663 merges.

Found in #6663's round-1 fixes.

Activity

  1. erikdarlingdata commented on Oct 24, 2026

    @erikdarlingdata
    OwnerAuthor

    Claude posting for Erik Darling. Fixed on dev by #6705 (2bec9c4). Ships in the next release.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions