Phase 2: Preserve authority state on failed batch revocation #623

Merged
erikinkinen merged 1 commit from phase2/bug-621-atomic-revocation into main 2026-10-20 17:40:27 +02:00
Owner

Task

Closes #621.

Summary

A failed multi-target epoch revocation could increment an earlier target and then fail on a later target at the u64 epoch limit. No event or delta was recorded, leaving authority changed outside the event history. Stage the complete revocation response and publish it only after every mutation and existing postcondition succeeds.

Scope

Included

  • Stage eager deletions, lazy markers and epoch changes in one EdgeStore copy.
  • Use the unchanged live state as the pre-response oracle input.
  • Regression coverage for later overflow, missing/duplicate targets and successful boundary publication.
  • Document the exact returned-error boundary and preserve before/after evidence.

Explicitly excluded

  • Changing successful strategy behavior, legacy metric meanings or event formats.
  • General transactionality for unrelated primitive events or process allocation failures.

Design intent

The staged result reuses the one store copy previously needed for the pre-response snapshot. An error discards the candidate; the existing dispatcher clears partial result fields and Engine records no event. A successful response publishes once with its normal event/time semantics.

Phase discipline

This repairs a preexisting failure-atomicity defect discovered while preparing Phase 2 measured mutations. Successful historical outputs remain exact compatibility fixtures.

Verification

The regression test failed on the original code with later epoch overflow mutated state without an accepted event and passes after the fix. All 49 tests pass at this exact source commit in Debug, Release and Clang 22 ASan/UBSan, including all 31 archived legacy cases. The fixtures cover both selector orders, all three mutation policies with a later invalid target, a duplicate deletion target and the largest successful epoch increment. Complete snapshots and the separate GrantId cursor remain unchanged across every failed response. All hooks pass.

Reproduction, before/after logs and full-suite evidence are attached to the issue. All eight exact-head Forgejo checks are required before checklist update and merge.

# Task Closes #621. ## Summary A failed multi-target epoch revocation could increment an earlier target and then fail on a later target at the u64 epoch limit. No event or delta was recorded, leaving authority changed outside the event history. Stage the complete revocation response and publish it only after every mutation and existing postcondition succeeds. ## Scope ### Included - Stage eager deletions, lazy markers and epoch changes in one EdgeStore copy. - Use the unchanged live state as the pre-response oracle input. - Regression coverage for later overflow, missing/duplicate targets and successful boundary publication. - Document the exact returned-error boundary and preserve before/after evidence. ### Explicitly excluded - Changing successful strategy behavior, legacy metric meanings or event formats. - General transactionality for unrelated primitive events or process allocation failures. ## Design intent The staged result reuses the one store copy previously needed for the pre-response snapshot. An error discards the candidate; the existing dispatcher clears partial result fields and Engine records no event. A successful response publishes once with its normal event/time semantics. ## Phase discipline This repairs a preexisting failure-atomicity defect discovered while preparing Phase 2 measured mutations. Successful historical outputs remain exact compatibility fixtures. ## Verification The regression test failed on the original code with `later epoch overflow mutated state without an accepted event` and passes after the fix. All 49 tests pass at this exact source commit in Debug, Release and Clang 22 ASan/UBSan, including all 31 archived legacy cases. The fixtures cover both selector orders, all three mutation policies with a later invalid target, a duplicate deletion target and the largest successful epoch increment. Complete snapshots and the separate GrantId cursor remain unchanged across every failed response. All hooks pass. [Reproduction, before/after logs and full-suite evidence](https://git.erikinkinen.fi/attachments/dfcdda6f-d9d8-4d76-889e-d6b5e8138ae6) are attached to the issue. All eight exact-head Forgejo checks are required before checklist update and merge.
erikinkinen added this to the Phase 2 milestone 2026-10-20 17:32:12 +02:00
Phase 2: Keep failed revocations atomic (#621)
All checks were successful
clang-format / check-format (pull_request) Successful in 31s
markdownlint / markdown-lint (pull_request) Successful in 31s
ci / sanitizers (pull_request) Successful in 5m28s
ci / smoke (pull_request) Successful in 5m30s
markdownlint / markdown-lint (push) Successful in 12s
clang-format / check-format (push) Successful in 13s
ci / smoke (push) Successful in 2m38s
ci / sanitizers (push) Successful in 2m38s
cf2c4a317c
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erikinkinen/AES!623
No description provided.