Skip to content

[BUG] 3.4.0 query_store collector runs 37–100 min on Azure SQL DB (3.3.0 median: 4.8 s) — starves all other collectors #2150

Description

@erikdarlingdata

Evidence (from the #2148 reporter's log — thank you, TrudAX)

Same two Azure SQL DB targets (elastic pool, edition 5, "version 12"), same day, before and after the 3.3.0 → 3.4.0 upgrade at 09:28–09:38 local:

build runs median max
3.3.0 (00:00–09:28) 198 4.8 s 31 s
3.4.0 (09:38–12:00) 6 99.8 min

Post-upgrade runs: 0.1 min (7,748 rows), 37.6 min (9,480), 46.1 min (11,845), 82.1 min (5,951), 0.1 min (19,873), 99.8 min (6,621). Bimodal — occasionally the old speed, usually catastrophic, on BOTH servers, at tiny row counts. sql: time ≈ wall time, so it's server-side execution, not storage writes.

Because Lite's collectors run sequentially, one 100-minute query_store cycle starves every other collector — this is the actual mechanism behind #2148's "all collection stopped" (the abandonment containment in #2149 protects backfill and the connection check; the LIVE collector pipeline is still sequential and still waits).

Why the 30s CommandTimeout never fired: rows trickle continuously, and SqlClient's timeout resets on every network read — a slowly-streaming result set never times out. Any fix should consider a wall-clock bound as defense in depth.

Suspects

QueryStoreCollector.cs changed by ~958 lines between v3.3.0 and v3.4.0 (the #2134 staged-#temp rewrite with OPTION(RECOMPILE) both statements + interval pre-filter, plus #2058 backfill plumbing). The rewrite was validated hard on SQL Server (fixed the fleet's wedged-core catch-up), but Azure SQL DB elastic pools differ in exactly the ways that matter: resource-governed tempdb, DTU throttling, and a different optimizer surface for the query_store TVFs. The bimodality smells like a per-cycle plan flip on the staged aggregate despite the RECOMPILE hints — or the Azure arm taking a different, unvalidated path.

Next steps

  1. Determine which arm (regular vs Azure) edition-5 targets execute in 3.4.0, and diff the emitted SQL against 3.3.0's.
  2. Repro on an Azure SQL DB/elastic pool at low eDTU with a non-trivial Query Store; capture the actual plan for the staged INSERT…/SELECT INTO at both speeds.
  3. Consider a wall-clock bound on the per-database item as containment regardless (the streaming-defeats-CommandTimeout gap).

Until fixed: 3.3.0 is the honest recommendation for Azure SQL DB users (told the reporter as much on #2148).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions