Skip to content

Analysis replay just past retention: the blocking baseline clamp moves the window start past its end and logs an ERROR #9152

Closed

Description

@erikdarlingdata

Claude posting for Erik Darling.

Component: Darling analysis baselines (PgBaselineProvider)
Build: 3.13.0-nightly.20261119.708 (e41e69b), schema 281. The code dates from #6712 (2026-10-24), so 696 has it too.

What happens

A get_analysis_facts replay logs this ERROR when its as_of is older than now minus the blocking collector's retention, but newer than the oldest row the store still keeps:

[ERROR] [DarlingMcpHostService] [PgBaselineProvider] Failed to compute baselines for blocking_snapshot after 0.0s: The window ends before it starts. (Parameter 'windowEndUtc')

The test replayed the same past days on four SQL Server targets, with hours_back 24 and as_of at 04:00Z on each day from 2026-10-19 to 2026-10-30. The store held rows back to 2026-10-21 00:00 UTC, and the retention was 30 days, so now minus retention was 2026-10-21 about 14:50 UTC. Five ERROR lines appeared, one or two per target, and all came from replays that end in the hours between those two points. Replays that end later did not log it. Replays that end earlier did not log it either: they return unavailable before they reach the baseline.

The call still answers. It returns facts with the partial coverage of that window. The ERROR is in the service log, and the blocking baseline is missing from that replay.

Cause

ClampToPlainViewPurgeHorizonAsync (PgBaselineProvider.cs, about line 1095) moves the baseline window start up to now minus retention. It does not compare that with the window end. When the analysis time is older than the horizon, the start moves past the end. BaselineLocalClock.Resolve then throws ArgumentException at BaselineLocalClock.cs:135, and the catch logs the exception as a failed baseline.

Suggested direction

When the clamped start is at or after the window end, return "no baseline" for that metric without calling Resolve. That case is an expected result of a replay past retention, not a failure, so log it at INFO or not at all.

Related, same replays

For a replay of a window entirely before retention, the MCP answer is now correct (#8910): "Retention removed it, and collection did not break". The service log still writes the older conclusion at WARN:

[WARN] [DarlingAnalysisService] No observed collection in the analysis window for <server> (10/06/2026 23:42:14 to 10/08/2026 23:42:14) despite 734.8h of total history: collection may be down (16 point-in-time fact(s) only)

Activity

  1. added
    bugSomething isn't working
    in-progressActively being worked by a local session or its agents (PR open or in flight)
    on Nov 20, 2026
  2. added a commit that references this issue on Nov 20, 2026
  3. erikdarlingdata commented on Nov 20, 2026

    @erikdarlingdata
    OwnerAuthor

    Claude posting for Erik Darling. Fixed by #9155, merged to dev. It ships in the next release.

  4. removed
    in-progressActively being worked by a local session or its agents (PR open or in flight)
    on Nov 20, 2026
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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions