Skip to content

test(durable): pin that a failed checkpoint after a landed Append doesn't wedge the Handle - #267

Merged
reka18 merged 1 commit into
mainfrom
test/durable-checkpoint-failure-regression
Nov 23, 2026
Merged

reka18 merged 1 commit into
mainfrom
test/durable-checkpoint-failure-regression

Conversation

@reka18

@reka18 reka18 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

What this does

#241 reported that a step whose Append landed but whose Checkpoint then failed left the Handle stuck: every later step hit ErrStepConflict on the reused step number. #243 (9ea0ded) already fixed that. recordStep now advances the step number as soon as the Append lands, and a failed checkpoint is returned to the caller without failing the Handle. This PR changes no behavior. It pins that fix so it can't quietly come back.

Tests

durable/checkpoint_failure_test.go makes one Checkpoint fail after a landed Append, at each entry seam that records a step:

Each test checks four things:

  • the call returns the checkpoint error, not ErrHandleFailed;
  • the step's Record is in the journal;
  • the next step succeeds;
  • a Recover matches the live Handle's snapshot and records at its next step number.

Making any one seam fail the Handle on a checkpoint error fails only that seam's test.

TestHandle_FailedCheckpointOnTick_KeepsGoing is removed, because the new Tick test makes all of its assertions. Its test Store, failingCheckpointStore, moves next to the new tests and gains a sentinel error, so all four tests share it.

Checks

  • mage check passes in every module (go1.27.4)
  • Each seam mutation-checked
  • No CHANGELOG entry: behavior doesn't change

Closes #241

…sn't wedge the Handle

A step whose Append lands but whose Checkpoint then fails once costs its caller only the checkpoint error: the Record is durable, so the Handle carries on and a Recover rebuilds the live Handle's state and step number. Four regression tests cover every seam that settles a step: Tick (the #241 reproduction), Fire, the RunService settle and DeliverToActor. Each fails one Checkpoint after the step's Append and checks the failed call returns the checkpoint error without ErrHandleFailed, that the next step succeeds, that the journal holds the Record, and that Recovers rebuild the live state and continue at the live Handle's next step.

The RunService settle and DeliverToActor pins share one table-driven test and, with the Tick and Fire ones, one failing store: failingCheckpointStore, which TestHandle_FailedCheckpointOnTick_KeepsGoing used, now failing once with a sentinel error the tests match with errors.Is. That superseded test is gone — the new Tick pin makes its assertions — and so is ckptFailStore, which it duplicated.

Signed-off-by: Ray Karnes <ray.karnes@stablekernel.com>
@reka18 reka18 added ready All ACR dimensions confirmed - clear to merge confirmed:correctness ACR clean: correctness confirmed:regression-safety ACR clean: regression-safety confirmed:concurrency-discipline ACR clean: concurrency-discipline confirmed:replay-determinism ACR clean: replay-determinism confirmed:api-compatibility ACR clean: api-compatibility confirmed:missed-context ACR clean: missed-context confirmed:human-readability ACR clean: human-readability confirmed:probes ACR: the probes lens's latest round found no blocker labels Nov 18, 2026
@reka18

reka18 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Review findings

The AI reviewers' pass over this change checked every review label and found no blockers. Three non-blockers were real, and all three are fixed in this commit:

  1. The first version covered only Tick and Fire. bug: durable: a failed checkpoint after a landed Append leaves the Handle stuck on ErrStepConflict #241 also names the RunService settle and DeliverToActor, and no existing test failed a checkpoint on either. Both now have a case, and each seam's mutation fails only its own test.
  2. TestHandle_FailedCheckpointOnTick_KeepsGoing was redundant. The new Tick test makes all of its assertions, so it's removed.
  3. The first version added a fourth checkpoint-failing test Store. It now reuses failingCheckpointStore, with a sentinel error added.

@reka18 reka18 added not-ready On every new PR until all review dimensions are confirmed ready All ACR dimensions confirmed - clear to merge and removed ready All ACR dimensions confirmed - clear to merge not-ready On every new PR until all review dimensions are confirmed labels Nov 18, 2026
@reka18
reka18 marked this pull request as ready for review November 23, 2026 09:23
@reka18
reka18 merged commit 12a90eb into main Nov 23, 2026
123 checks passed
@reka18
reka18 deleted the test/durable-checkpoint-failure-regression branch November 23, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

confirmed:api-compatibility ACR clean: api-compatibility confirmed:concurrency-discipline ACR clean: concurrency-discipline confirmed:correctness ACR clean: correctness confirmed:human-readability ACR clean: human-readability confirmed:missed-context ACR clean: missed-context confirmed:probes ACR: the probes lens's latest round found no blocker confirmed:regression-safety ACR clean: regression-safety confirmed:replay-determinism ACR clean: replay-determinism ready All ACR dimensions confirmed - clear to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: durable: a failed checkpoint after a landed Append leaves the Handle stuck on ErrStepConflict

2 participants