Skip to content

fix: measure archive age at the collected snapshot time - #89

Open
DivyamTalwar wants to merge 1 commit into
pgrundev:mainfrom
DivyamTalwar:fix/measure-archive-age-at-collection
Open

DivyamTalwar wants to merge 1 commit into
pgrundev:mainfrom
DivyamTalwar:fix/measure-archive-age-at-collection

Conversation

@DivyamTalwar

Copy link
Copy Markdown
Contributor

What and why

Closes #88.

Use a single interval from Context.CollectedAt to 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_reset substitute is added for never-successful archiving.

Verification

Verified commit: eec581ef33fd359ad0f025f0879124b48221ae08.

  • Fixed-epoch regressions fail on upstream 282ffe8fdd7acdd7b6e1dbd8cf04c155401d3a92: an at-collection healthy snapshot becomes a critical many-day stall, and threshold/display-age controls use the wrong clock.
  • Focused archiving boundary and serialized-context regressions passed 20 repetitions under 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 and git diff --check clean.
  • Controls cover below/equal/above thresholds, unknown/future timestamps, managed providers, missing WAL/archiver sections, explicit failures and input immutability.

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

  • Committed-HEAD gate and full race suite pass.
  • Read-only, privacy and deterministic-finding invariants preserved.
  • No new finding or model JSON field; catalog/schema unchanged.

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.
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.

WAL archiving findings change with wall-clock time for an identical Context

1 participant