Skip to content

Derive the TimescaleDB ensure-summary log from its own source (#1746) - #1747

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/1746-cagg-count-log
Jul 27, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
feature/1746-cagg-count-log

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Closes #1746. Reported from a client-site upgrade.

The defect

The ensure sweep's summary line got its counts right — {Ready}/{Total} is computed from the aggregate array, so it correctly said 8 — while its parenthetical text was hand-written and still read:

3 hourly: query_stats, procedure_stats, query_store_stats; 3 daily: query_stats, procedure_stats, query_store_stats

That enumeration predates #1664, which added query_stats_db_hourly / query_stats_db_daily. So the line said 8 and then listed 6, and an operator mid-upgrade spent real time reconciling the two before concluding it wasn't a bug. False operator-facing text that cost more than the thing it was describing.

The fix is the shape, not the number

Replacing 3 hourly with 4 hourly would have been the same defect rearmed — correct until the next pair lands. The names are now derived from the same array the counts come from, so the summary quotes its own source and cannot drift from it:

TimescaleDB: {Ready}/{Total} continuous aggregate(s) ready ({Views})

where {Views} is string.Join(", ", aggregates.Select(a => a.View)). Adding a ninth aggregate updates the log for free.

Sibling sweep

Checked every operator-facing summary in TimescaleSupport for the same class:

  • Retention summary — interpolates computed counts plus the RawRetentionInterval / HourlyRetentionInterval constants. Clean.
  • Hypertable and compression summaries — {Converted}/{Total}, {Applied}/{Total}, {Days} from constants. Clean.
  • Stale-CAGG drop line — parameterized on the single view. Clean.
  • RetentionPolicyCount = 7 and its "three raw tables plus four hourly CAGGs" comment — verified against the policy array (3 raw + 4 hourly). Accurate, left alone.

The DuckDbInitializer lines that enumerate query_stats, procedure_stats, query_store_stats are historical migration messages describing what v2/v6/v13 each did — accurate for their own migration, not statements about current state. Left alone.

So this was the only instance.

Tests

Darling.Tests   3359 passed, 0 failed (159 skipped - the live-Postgres gated set)

No test pinned the old text, which is part of why it drifted unnoticed.

Unrelated observation: dev currently builds with 3 warnings against its zero-warning policy — CS8602 at Lite/MainWindow.AlertEngine.cs:262 and xUnit2031 at Lite.Tests/AgAlertEvaluatorTests.cs:225, both from the AG-alerts work. Neither is in this diff; flagging rather than absorbing.

🤖 Generated with Claude Code

The line's counts were computed ({Ready}/{Total}, correctly reporting 8)
but the parenthetical text was hand-written and still enumerated the six
aggregates that existed before #1664 added the db-grain pair. An operator
mid-upgrade at a client site spent real time reconciling 8-against-6
before concluding it was not a bug.

Fixed by shape rather than by number: the names now come from the same
array the counts come from, so the summary quotes its own source and a
future pair cannot make it stale again. Replacing "3 hourly" with "4
hourly" would have been the same defect waiting to recur.

Swept the sibling summary lines for the same class. The retention,
hypertable and compression lines already interpolate computed counts and
interval constants, and the RetentionPolicyCount = 7 comment (three raw
plus four hourly) checks out against the policy array. This was the only
hardcoded enumeration.

Closes #1746

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@erikdarlingdata
erikdarlingdata merged commit 4d881f7 into dev Jul 27, 2026
4 checks passed
@erikdarlingdata
erikdarlingdata deleted the feature/1746-cagg-count-log branch September 12, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant