Skip to content

fix(durable): land checkpoints when tick barriers step over the interval - #237

Draft
reka18 wants to merge 1 commit into
fix/durable-timersfrom
fix/durable-checkpoint-cadence
Draft

reka18 wants to merge 1 commit into
fix/durable-timersfrom
fix/durable-checkpoint-cadence

Conversation

@reka18

@reka18 reka18 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What this change does

A checkpoint now lands on any step that crosses a WithCheckpointEvery boundary. Stacked on #236. This is the top of the #214 chain.

Such an instance now compacts, so on a Store without HistoryStore, StateAt can't reach the steps before its latest checkpoint. It answers with the checkpoint's state, or ErrStepOutOfRange when the checkpoint left the tail empty, as it already did for a run of Fires. The cadence is unchanged for plain steps. A Tick record can now checkpoint on a step other than the usual one.

Why

A Tick record spans several step ordinals, so it could miss the interval forever and the tail grew without limit. A review of #232 found this. It isn't listed in #214.

Still open in #214 after this chain: telemetry on replay (question 7), which #214 defers, and the machine version opt-in (question 6). Questions 3 and 4 need a ruling.

Relates to: #214

Evidence

On GOTOOLCHAIN=go1.27.3, in durable:

Command Result
go test ./... pass. TestTimerCheckpoint_BarriersCannotStepOverTheInterval is new, and it fails on the previous commit with a 52-record tail
go test -race ./... pass, 0 race warnings
Pinned golangci-lint 0 issues
go test ./... in state, cluster, e2e, transport, source, examples/dispatch, examples/fooddelivery pass

Checklist

  • Commits are signed off (git commit -s) per the DCO
  • Conventional commit messages (type: subject)
  • mage check passes locally (lint + race tests + govulncheck): not run as a whole
  • Tests added/updated for the change
  • Public API changes documented (godoc) and, if applicable, noted for the changelog

@reka18 reka18 added not-ready On every new PR until all review dimensions are confirmed wait:correctness ACR pending: correctness wait:regression-safety ACR pending: regression-safety wait:concurrency-discipline ACR pending: concurrency-discipline wait:replay-determinism ACR pending: replay-determinism wait:api-compatibility ACR pending: api-compatibility wait:missed-context ACR pending: missed-context wait:human-readability ACR pending: human-readability labels Nov 5, 2026
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 62baca3 to 83ecbc2 Compare November 5, 2026 16:38
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 83ecbc2 to bce6f35 Compare November 5, 2026 16:40
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from bce6f35 to ab5eb13 Compare November 5, 2026 16:54
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from ab5eb13 to 52bf074 Compare November 5, 2026 17:09
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 52bf074 to 89ffcbe Compare November 5, 2026 17:14
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 89ffcbe to ed08880 Compare November 5, 2026 17:22
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from ed08880 to a565080 Compare November 5, 2026 17:34
@reka18
reka18 added this pull request to stack #238 November 5, 2026 17:34
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from a565080 to 63db9e4 Compare November 5, 2026 17:42
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 63db9e4 to 7120b33 Compare November 5, 2026 18:04
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 7120b33 to 785fea6 Compare November 5, 2026 18:20
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 5fdbbbe to 32182bc Compare November 5, 2026 19:05
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 32182bc to ce67387 Compare November 5, 2026 19:19
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from ce67387 to fd39fb6 Compare November 5, 2026 19:28
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from fd39fb6 to 6426343 Compare November 5, 2026 19:39
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 6426343 to 6698028 Compare November 5, 2026 19:48
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 6698028 to 5a44b97 Compare November 5, 2026 20:10
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 5a44b97 to 38fa17d Compare November 5, 2026 20:23
@reka18
reka18 removed this pull request from stack #238 November 5, 2026 20:26
@reka18
reka18 added this pull request to stack #239 November 5, 2026 20:26
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 38fa17d to 2dcccbb Compare November 5, 2026 20:52
@reka18
reka18 force-pushed the fix/durable-checkpoint-cadence branch from 2dcccbb to b3d0e06 Compare November 5, 2026 21:02
@reka18 reka18 added ready All ACR dimensions confirmed - clear to merge confirmed:correctness ACR clean: correctness and removed not-ready On every new PR until all review dimensions are confirmed wait:correctness ACR pending: correctness wait:regression-safety ACR pending: regression-safety wait:concurrency-discipline ACR pending: concurrency-discipline wait:replay-determinism ACR pending: replay-determinism wait:api-compatibility ACR pending: api-compatibility wait:missed-context ACR pending: missed-context labels Nov 5, 2026
@reka18

reka18 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Review results. One reviewer per dimension, each reading the others' findings. All seven dimensions have zero blockers on the latest round.

Fixed along the way: a test the new cadence had stopped exercising now pins a non-empty tail, and the StateAt behavior on compacted steps is disclosed.

Known limit: StateAt below the latest checkpoint returns the checkpoint's state without an error on a Store with no history. That predates this PR and needs its own issue.

A tick barrier spans several step ordinals, so WithCheckpointEvery could miss
its multiple forever and the tail grew without limit. A checkpoint now lands on
any step that crosses a boundary.

Relates to #214.

Signed-off-by: Ray Karnes <ray.karnes@stablekernel.com>

This branch has not been deployed

No deployments
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: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.

1 participant