Repository navigation
Pin that a non-empty superseded baseline aggregate is kept while its successor is short (#4292) - #4441
Merged
Conversation
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.
Refs #4292.
Why
The retirement sweep for a superseded baseline continuous aggregate has two live pins today, both covering the case where the legacy aggregate is EMPTY. There was no live pin for the opposite, and more common, case: a legacy aggregate that still HOLDS rows, paired with a successor whose own oldest bucket has not yet reached the retention horizon. In that state the judge is supposed to return
SuccessorShortand the sweep must leave the legacy alone. Without a pin, an edit that mishandled the "holds rows" branch could ship green while it silently dropped a legacy aggregate full of baseline history the successor hasn't caught up to yet.What changes
Test-only. Adds one live fact,
NonEmptyLegacyAggregate_SuccessorShort_IsKept, alongside the existing empty-legacy facts inRetiredBaselineAggregateTests.cs. It seeds two rows intocollect.wait_stats(one 40 days back, one 5 days back), leaves the legacywait_stats_baselineaggregate unrefreshed so its real-time aggregation unions in both raw rows regardless of age, and refreshes the successorwait_stats_interval_baselineonly from the 5-day-back hour forward — the same trick the file's existing end-to-end supersession fact uses to make a successor's own oldest bucket land after a horizon that the legacy still predates. It then runs the product's own judge and drop pass (TimescaleSupport.JudgeSupersededBaselineRelationAsyncandDropRetiredBaselineAggregatesAsync), not the pure decision helper, and asserts the verdict isSuccessorShort,LegacyHoldsRowsis true, nothing gets dropped, and the legacy relation still exists and still returns its rows afterward.Test plan
EmptySupersededBaselineLiveTests(all 3 facts, including the new one): GREEN, 3/3, against a local TimescaleDB container.legacyHoldsRows = await probe.ExecuteScalarAsync(cancellationToken) is not false;tolegacyHoldsRows = false; await probe.ExecuteScalarAsync(cancellationToken);atTimescaleSupport.cs(~1358). The new fact went RED:Assert.Equal() Failure: Values differ / Expected: SuccessorShort / Actual: Dropat the verdict-decision assertion.Reverted the line; rebuilt 0 errors; reran the class: back to GREEN, 3/3.
BaselineSupplyTests: GREEN, 23/23.DocCommentHygieneTests: GREEN, 77/77.Darling.Tests: 0 warnings/0 errors after the mutation revert;Lite.Testsuntouched by this change — no Lite file was edited, so its build was not re-run for this change).CHANGELOG entry
SECTION: None
ENTRY: None: test-only change, adds a live pin with no product-code effect.