[P2] Repair observation/accounting events after local crash windows #82
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Discovered by
Post-merge adversarial review of PR #78 / #57.
Problem
Recording an authoritative observation is intentionally ordered as separate durable writes:
This ordering correctly protects the observation itself, but it leaves a local crash window after the observation/observed revision is durable and before the accounting/history event is appended.
After restart:
decision_for_existing/2sees the immutable observation and immediately returns replay;observedattempt is not repaired bysettle_observed_status/1;observation_recordedevent is reconstructed exactly once.The result can be an authoritative successful observation whose usage/provenance is absent from the event stream that the current docs say #44/#45 may consume.
The same general question applies to lifecycle events around other multi-write transitions, but observation usage/provenance is the important accounting case.
Required invariant
The durable observation is authoritative. Event/history materialization must be recoverable/idempotent from authoritative state after any local crash between persistence writes.
Do not solve this by making the external effect run again.
Suggested direction
Required tests
Use fresh SWI processes and explicit crash markers, not sleeps:
Refs #57 #44 #45 #80