Repository navigation
Count archived history in the analysis warm-up, and read v_ views everywhere (#1809) - #1811
Merged
Merged
Conversation
…rywhere (#1809) The 24h sufficiency check measured the span on raw wait_stats; the 512MB ArchiveAllAndResetAsync empties the hot store, so multi-server installs that reset sub-daily never finished warm-up. The check now reads v_wait_stats (hot + parquet). The broken gate was also shielding the same defect downstream: the fact collector read raw tables in 22 more places, including the on-load config snapshots that are EMPTY after a reset until the next app start. Gate-only would have analyzed a thin post-reset window - the exact distortion the floor exists to prevent. All 23 sites now read their v_ archive views, and a catalog-driven sweep guard (ArchivableTables) fails on any raw FROM in Lite/Analysis, naming the file. Verified: behavioral fixture proves the span counts hot + archived parquet across a simulated reset and still gates a young install; watched red by reverting the query (both guards fired); full Lite.Tests 1601/1601; zero warnings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…spans-archives # Conflicts: # CHANGELOG.md
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.
Closes #1809.
The reported bug — confirmed exactly
AnalysisService.GetTotalDataSpanHoursAsyncmeasured MIN..MAX(collection_time) on RAWwait_stats— the hot store only. The 512 MB threshold callsArchiveAllAndResetAsync, which copies everything to Parquet and empties the hot store, so the measured span restarts at every reset. On a multi-server install that resets more often than daily, the Recommendations warm-up can never reach 24 hours — while the archived history sits in Parquet, readable through thev_union views every other tab already uses. The reporter's option 1 (count archived + hot) is what shipped; no new knob.Why it's a 23-site sweep, not a one-word fix
The broken gate was accidentally SHIELDING a second instance of the same defect. The fact collector read raw tables in 22 more places: the analysis-window reads (query stats/snapshots, memory, perfmon, file IO, blocking, deadlocks, storage, sessions, jobs, memory clerks/pressure, plan cache, CPU scheduler) and the on-load config snapshots (server/database config, trace flags, server properties) — which after a reset are EMPTY until the next app start. Fix only the gate and post-reset runs would analyze a thin hot window: the exact fraction-of-period distortion the 24-hour floor exists to prevent. So the gate and the reads move together — all 23 sites now read their
v_archive views.Safety of the swap, verified not assumed: the views are column-identical to their tables by construction (only
config_alert_log's view adds asourcecolumn, and analysis never reads it); the QUALIFY-dedup views make re-collected post-reset rows appear exactly once; there is noSELECT *anywhere in Lite/Analysis.Guards
ArchiveService.ArchivableTables, a rawFROM {table}anywhere in Lite/Analysis fails with the file named — a new collector's table is guarded the day it exists.Test plan
🤖 Generated with Claude Code