Repository navigation
feat(streaming): add reusable checkpoint state machine - #11154
Merged
ReubenBond merged 1 commit intoSep 10, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It introduces new public API surface and a concurrency-sensitive checkpoint state machine whose correctness is critical to recovery behavior and warrants final human validation.
Review tier: Lite
Findings: None
What changed in this PR
This PR extracts a reusable, provider-agnostic checkpoint coordination core for Orleans streaming, so custom queue adapters can reuse checkpoint coalescing/throttling/flush and optimistic-conflict handling without depending on the grain-backed implementation.
Changes:
- Introduces a reusable checkpoint persistence abstraction (
IStreamCheckpointStore) and state representation (StreamCheckpointStoreState), plus theStreamQueueCheckpointerstate machine andStreamQueueCheckpointerOptions. - Refactors
GrainStreamQueueCheckpointerto delegate checkpoint coordination to the new reusableStreamQueueCheckpointerwhile preserving the grain-backed storage facade. - Adds focused contract tests for numeric boundary behavior and optimistic conflict/retry behavior; updates custom adapter docs and regenerates the Orleans.Streaming public API surface.
| File | Description |
|---|---|
| test/Orleans.Streaming.Tests/Checkpointers/StreamQueueCheckpointerTests.cs | Extends shared contract tests to validate numeric-boundary progression scenarios. |
| test/Orleans.Streaming.Tests/Checkpointers/ReusableStreamQueueCheckpointerTests.cs | Adds contract tests specific to the reusable checkpointer, including version-conflict retry and retry-after-failed-write behavior. |
| src/Orleans.Streaming/Checkpointers/StreamQueueCheckpointerOptions.cs | Adds public options for persist throttling interval and optional monotonic comparer. |
| src/Orleans.Streaming/Checkpointers/StreamQueueCheckpointer.cs | Adds the reusable checkpoint coordination state machine (coalescing, throttling, flush, conflict handling). |
| src/Orleans.Streaming/Checkpointers/StreamCheckpointStoreState.cs | Adds the public state container for checkpoint + backend version/etag. |
| src/Orleans.Streaming/Checkpointers/IStreamCheckpointStore.cs | Adds the reusable persistence abstraction for conditional checkpoint updates. |
| src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs | Refactors to use the reusable state machine via an adapter over the existing grain API. |
| src/api/Orleans.Streaming/Orleans.Streaming.cs | Regenerated public API to include the new types. |
| docs/site/src/content/docs/streaming/custom-queue-adapter.md | Documents composing a durable custom checkpoint store with the reusable checkpointer. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 3, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Checkpoint throttling, coalescing, retry, monotonicity, and optimistic-conflict handling are embedded in the Grain-backed implementation, so custom queue adapters cannot reuse those guarantees with their own durable checkpoint store.
This extracts the checkpoint-focused first wave from #11076 and reconciles overlapping code with the newer #10588 foundation.
Solution
IStreamCheckpointStore,StreamCheckpointStoreState,StreamQueueCheckpointer, andStreamQueueCheckpointerOptionsas the reusable checkpoint core.GrainStreamQueueCheckpointerto the reusable state machine while preserving its public facade and storage-provider behavior.Rationale
Separating persistence from checkpoint coordination gives custom adapters one implementation of the state-machine guarantees while keeping the existing Grain adapter as an immediate production consumer. Provider migrations, replay, pooled cache, pulling-agent, and receiver changes remain independent follow-ups.
Related #756
Microsoft Reviewers: Open in CodeFlow