Repository navigation
On-load config collectors also recapture daily, not just on connect (#3929) (#3930) - #4001
Merged
Merged
Conversation
…3929) (#3930) server_config, database_config, database_scoped_config, trace_flags and server_properties ran once per connect and never again on a healthy connection. A server connected 30+ days lost its only capture to the 30-day retention purge (#3930), and TRACE_FLAGS took each flag's latest row across all history with no time bound, so a flag turned off never got another row to supersede its stale ON one (#3929). CollectorScheduleDefaults.OnLoadRecaptureMinutes/EffectiveRecurringIntervalMinutes is the one place "on-load" (frequency 0) becomes a daily periodic interval, used by Darling's worker (the connect seed, reload recompute and due-collector sweep) and Lite's ScheduleManager instead of special-casing the five collectors by name. An operator's own override still wins. The TRACE_FLAGS read is now bounded by the same on-load-aware lookback instead of an unbounded partition, in both SKUs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GdmA4ND1wLSqA91ax1m4xv
…rops out at the next daily capture (#3929) The bounded read kept each flag's own newest row inside the on-load lookback, so a flag turned off while another stayed on lingered until its last ON row left the roughly 48-hour window. Anchoring on the newest capture inside the same window drops it at the next capture. A capture that finds every flag off still writes no row and falls back to the one before it, bounded by the window as before. Both SKUs; a new live test (Darling) and unit test (Lite) fail on the per-flag shape. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GdmA4ND1wLSqA91ax1m4xv
erikdarlingdata
enabled auto-merge (squash)
September 23, 2026 06:11
This was referenced Sep 23, 2026
erikdarlingdata
added a commit
that referenced
this pull request
Sep 23, 2026
…ntries in their sections (#4080) Adds 42 entries and 42 link refs (#3992, #3995, #3996, #3998, #4001, #4002, #4003, #4007, #4010, #4011, #4013, #4015, #4020, #4022, #4025, #4029, #4030, #4031, #4036, #4038, #4039, #4040, #4044, #4047, #4048, #4049, #4050, #4051, #4055, #4061, #4063, #4064, #4065, #4066, #4067, #4068, #4069, #4070, #4071, #4073, #4074, #4078). Each PR's entry was buffered, and this lands every entry whose PR was merged on origin/dev when it ran. #3989 left 26 entries under bare 'Changed' and 'Fixed' lines above '### Added'. They move into '### Changed' and '### Fixed', below the new entries, and one blank line stays under [Unreleased]. Claude-Session: https://claude.ai/code/session_01Ua31ugERL5DmhFVRtf6keQ Co-authored-by: Claude Opus 5.5 <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.
Closes #3929. Closes #3930.
Why
Five config collectors (
server_config,database_config,database_scoped_config,trace_flags,server_properties) run once per connect (FrequencyMinutes0 inCollectorScheduleDefaults) and neveragain while the connection stays healthy.
CONFIG_*,DB_CONFIG,TRACE_FLAGSand the config audit have nothing to read until the next reconnect.TRACE_FLAGSpartitioned each trace flag's latest row across all retained history with no timebound.
DBCC TRACESTATUS(-1)only ever lists flags that are ON, so a flag turned off never got another rowto supersede its stale ON one - it kept reporting as enabled for up to 30 days after being turned off.
Erik ruled (both issues, 2026-09-23): re-capture the on-load collectors daily, in addition to on connect. That
fixes both.
What changes
CollectorScheduleDefaults.OnLoadRecaptureMinutes(1440) andEffectiveRecurringIntervalMinutesare the oneplace "on-load" (frequency 0) becomes a concrete periodic interval. Darling's worker (the connect-time seed,
the reload recompute, and the due-collector sweep - three call sites that all previously treated frequency 0
as "never schedule again") and Lite's
ScheduleManager.GetDueCollectorsForServerboth call it instead ofspecial-casing the five on-load collectors by name. An operator's own override (any frequency > 0) is
untouched, since the substitution only fires when the EFFECTIVE (post-override) frequency resolves to 0.
TryConnectAsyncon-load loop; Lite'sRunAllCollectorsForServerAsynctab-open path, which already runs every enabled collector unconditionally).TRACE_FLAGS's read (DarlingPgFactCollector.Config.TraceFlagsSql, LiteDuckDbFactCollector.Config) isnow bounded by
capture_time BETWEEN $2 AND $3- the on-load-aware lookback (a day, or twiceOnLoadRecaptureMinutesif longer; 48h at the shipped daily default) and the window's end, matching everyother latest-value read (Analysis 'latest value' reads scan a server's entire retained history: half of every analyze_server call, and the database-size fact counts dropped databases (all three SKUs) #3896/Latest-value lookbacks follow the collector's cadence: a day, or twice its interval if longer (#3896) #3980). A flag missing from the whole window (about two daily captures) has
no row there at all and simply drops out - including the "every flag is off" case, where the OLD
MAX(capture_time)anchor Analysis 'latest value' reads scan a server's entire retained history: half of every analyze_server call, and the database-size fact counts dropped databases (all three SKUs) #3896 used forDB_CONFIGwould have silently fallen back to an older, stale-ONcapture (a capture that finds nothing on writes zero rows, so
MAXnever sees it).server_config/database_config/server_propertiesneeded no read change: their existing "newest capture"anchors are already correct once that capture is at most a day old, which the scheduling half of this PR
guarantees.
of TRACE_FLAGS keeps reporting a trace flag for weeks after it is turned off #3929's defect in the MCP
get_trace_flagstool and the web viewer) and On-load collectors are now staleness-exempt forever in CollectorHealthClassifier, even though they recapture daily #4000 (the health classifier'spermanent on-load staleness exemption, now a blind spot since these collectors have a real cadence).
Test plan
TraceFlagsSql's bound (Darling) andreverted
GetDueCollectorsForServer's substitution (Lite) one at a time, confirmed the new tests fail (3Darling, 3 Lite), restored the fix, confirmed green.
(56, incl. 3 new), StoreConfigProviderTests (14, incl. 3 new), CollectorHealthClassifierTests,
SweepPressureClassifierTests, DarlingSweepSchedulingTests, PgFactCollectorTests, StartupCommandTimeoutTests,
AlertReadFailureSurfaceTests, DocCommentHygiene (248 total across that second batch) - all green.
DeltaFamilyScheduleBoundTests, CollectorHealthClassifierTests, SweepPressureClassifierTests,
SharedCollectorDefaultsPinTests, CrossAppPresetValuePinTests, ConfigCollectorsDefinitionTests, ParitySource
(89 total across that batch) - all green.
Lite.Testssuite once: 5160 total, 1 failure. The failure (StatusBarSizeReadLockTests, anunrelated write-lock-contention timing test) re-ran green alone - a pre-existing flake, not touched by this
PR.
Darling.Testssuite once, against the same private rig: 12,941 total, 0 failures, 27 skipped (allgated on runtime/role-provisioning env vars this PR does not touch -
DARLING_TEST_PGRUNTIMEand friends).Filed separately (parked, not in this PR)
get_trace_flagstool and the web viewer's trace-flags read share a narrower version ofTRACE_FLAGS keeps reporting a trace flag for weeks after it is turned off #3929's defect (
MAX(capture_time)silently falls back to a stale capture when the newest one found zeroflags on). Real but distinct from the analysis-fact defect this PR fixes, and touches display-surface files
this PR doesn't otherwise change.
CollectorHealthClassifier.Classifystill exempts on-load collectors from staleness bands forever.Now that they recapture daily, a genuinely-stuck on-load collector could be flagged like any other daily
one - but that needs a threshold ruling and touches SQL call sites across the fleet rollup and per-server
health reads this PR doesn't otherwise touch.
Follow-up commit (coordinator)
🤖 Generated with Claude Code
https://claude.ai/code/session_01GdmA4ND1wLSqA91ax1m4xv