Repository navigation
Darling on plain PostgreSQL: the blocking and deadlock baselines stop at the purge horizon (#6706) #6712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Darling on plain PostgreSQL: the blocking and deadlock baselines stop at the purge horizon (#6706) #6712
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
a30a769
Darling on plain PostgreSQL: the blocking and deadlock baselines stop…
erikdarlingdata 21b2c80
Merge branch 'dev' into fix/6706-plain-pg-event-floor
erikdarlingdata f6b7a8d
Reuse TimescaleSupport.ResolveMaterializationAsync for the plain-view…
erikdarlingdata File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking, and the body already names half of it: the horizon is anchored on the wall clock, while every other input of this compute is anchored on
windowEnd— the cache key's own instant.The PR body says a cached entry "is valid for the UTC day like every other input of the compute". It isn't quite like the others.
windowEnd = RoundedKeyTime(...)is the key;windowStart, the clock resolve and the$2/$3binds all derive from it, which is what lets this class's own doc claim (lines 38–42, restated at 951–956) that "the window ends on the analysis HOUR the cache keys on, so a shared entry is the answer a fresh compute would give." With the horizon on_time.GetUtcNow(), two computes inside one cached UTC day — the worker's pass at 01:00 and an MCPanalyze_serverat 23:00 on a cache miss, sharingBaselineCache— ask for windows 22 hours apart at the start. Whichever lands first wins the day, so a shared entry is no longer the answer a fresh compute would give. Bounded (at most the oldest day's hours) and in the safe direction, so not a correctness complaint.windowEndwould restore it, and it is the instant the purge horizon is actually being compared against — the window the arm reads ends there, so "what did raw still hold over this window" is a question aboutwindowEnd, not about now:That also makes the whole
TimeProviderseam unnecessary: the fixed clock the six existing live tests now have to be handed (DarlingEventBaselineCoveredDaysTests.cs:278) exists only because the horizon reads a clock the test cannot set otherwise, and awindowEnd-anchored floor is already deterministic fromAnalysisTime. On a default-retention store it is also exactly the "rounded down to the UTC day" variant the body offers, for free, sincewindowEndfor these two daily arms is a UTC midnight (RoundedDay, line 479) —windowEnd - 30d == windowStart, so the default store stops changing at all rather than losing the oldest day's early hours.The one behavioural difference to weigh before taking it: for an analysis whose
analysisTimeis historical (context.TimeRangeStartisnow - hoursBack, sowindowEndtrailsnowby up to a day at the default and further on a widehours_back), awindowEndanchor floors the window where raw stood then rather than now, which admits days the purge has since taken. Both readings are defensible; the clock-anchored one is the more conservative, the key-anchored one is the one the cache contract is written for.