Skip to content

Readability refactor - #19

Merged
jessestimpson merged 6 commits into
mainfrom
readability-refactor
Nov 1, 2026
Merged

jessestimpson merged 6 commits into
mainfrom
readability-refactor

Conversation

@jessestimpson

Copy link
Copy Markdown
Contributor

No description provided.

jessestimpson and others added 6 commits October 31, 2026 13:30
Rename the #state record to #data. handle_event/4 now handles the enter
call first (dispatching to the state function), then events shared by all
states, then falls through to apply(?MODULE, State, ...). The leader-,
follower-, searching- and assuming-specific clauses move into state
functions, with leaderless/3 and non_leader/3 holding behavior common to
the non-leader states. handle_call/3, handle_cast/2, handle_info/2 and
handle_continue/2 are removed. Also rename arm/2 to schedule_timer/2,
keeping the `arm` eta log label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A follower holds a forwarded `yes` until its replica reaches the commit
version. After a degraded handoff, the new leader's versions could get it
there without that commit, so the follower acked a lost registration.

- A batch from a later epoch is now a gap. Only the new leader's snapshot
  moves a replica into a new epoch.
- The leader's register reply carries its epoch. A held `yes` is released
  only in that epoch, and is re-driven to the current leader otherwise.
- A new leader stops waiting for the old leader's in-flight commits as soon
  as every member has seen the old leader go down, instead of waiting out
  the 2 second deadline. The gather reply gains a `LeaderGone` flag, and the
  0.4.x reply shape is no longer accepted.

The TLA+ model gains `EpochFencedAck` and `LeaderGoneAssume`. The new
NoEpochFence config reproduces the false ack, and LeaderGoneAssume now also
checks UniqueBinding and DurableAcked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new Design page shows the messages behind each registry operation as
swimlane diagrams. The SVGs and the page are generated by
docs/tools/registry_flows.py, and ExDoc copies docs/design/assets.

The simulation harness README joins the Formal Methods section. It is
renamed to dgen_registry_simulation.md because ExDoc resolves links by file
name, and three README.md extras sent every README.md link to the same page.
Also fixes the stale dgen_registry_member.erl path in formal/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jessestimpson
jessestimpson merged commit 5ea2580 into main Nov 1, 2026
19 checks passed
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.

1 participant