fix: measure archive age at the collected snapshot time - #89
Open
DivyamTalwar wants to merge 1 commit into
Open
DivyamTalwar wants to merge 1 commit into
DivyamTalwar wants to merge 1 commit into
Conversation
WAL archiving analysis used time.Since twice, so recomputing an identical Context later could invent a critical stall and report a different age. Use one interval from Context.CollectedAt for both threshold and evidence; a missing collection timestamp remains unknown rather than using now. Retain threshold, managed-provider and explicit-failure handling. Clarify that the short WAL sample is not proof of continuous generation or an eligible-segment backlog; do not substitute stats_reset when there has never been a successful archive. Fixed-epoch serialized-context and boundary regressions fail on 282ffe8. They pass 20 race-enabled repetitions and full findings/model/CLI race tests pass. No collector SQL, schema or dependency changes.
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.
What and why
Closes #88.
Use a single interval from
Context.CollectedAtto the last successful archive for both the stall threshold and displayed age. The former wall-clock calls let identical serialized input change its finding when recomputed later. A missing collection timestamp remains unknown.Preserve existing thresholds, managed-provider downgrades and explicit-failure selection. The documentation and detail text distinguish the sampled signals from a confirmed eligible-segment backlog. No
stats_resetsubstitute is added for never-successful archiving.Verification
Verified commit:
eec581ef33fd359ad0f025f0879124b48221ae08.282ffe8fdd7acdd7b6e1dbd8cf04c155401d3a92: an at-collection healthy snapshot becomes a critical many-day stall, and threshold/display-age controls use the wrong clock.go test -race.go test -race ./internal/findings ./internal/model ./cmd/pgbot: passed.bash scripts/gate.sh: passed on committed HEAD, including pinned lint, unit tests and all six release-target builds.go test -race ./...: passed; formatting andgit diff --checkclean.Scope and risk
The reproduction calls the actual findings engine with serialized fixed-epoch contexts; current offline diff/why commands do not themselves recompute stored findings. No live WAL incident or PostgreSQL integration pass is claimed. Unknown collection time now suppresses this age-dependent inference. No collector SQL, dependency, schema or finding-ID changes; revert this commit to restore the previous clock selection.
Checklist