feat(streaming): add grain-backed stream checkpointer - #10345
Merged
ReubenBond merged 5 commits intoAug 7, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3f5060d4-b229-476c-bdf3-9923ad459bb2
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a provider-independent, grain-storage-backed stream queue checkpointer to Orleans.Streaming, adds a reusable checkpoint comparer (numeric ordering for arbitrary-sized offsets), and wires the new checkpointer into Event Hubs as an opt-in alternative to the existing Azure Table checkpointer. It also adds deterministic contract tests to validate persistence, throttling, flushing, cancellation, failure propagation, and monotonic update behaviors.
Changes:
- Add
GrainStreamQueueCheckpointer(+ factory/options) and supporting grains/state for persisting checkpoints via Orleans grain storage. - Add
StreamCheckpointComparers.Numericand tests to ensure safe numeric ordering for Event Hubs-style offsets. - Add configuration extensions + docs/tests so Event Hubs providers can opt into the grain-based checkpointer while preserving existing defaults.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.Streaming.Tests/Checkpointers/StreamQueueCheckpointerTests.cs | Adds deterministic contract tests for IStreamQueueCheckpointer<string> implementations. |
| test/Orleans.Streaming.Tests/Checkpointers/StreamCheckpointComparersTests.cs | Adds unit tests for the new numeric checkpoint comparer behavior. |
| test/Orleans.Streaming.Tests/Checkpointers/GrainStreamQueueCheckpointerTests.cs | Adds tests for grain-backed checkpointer behavior and grain/state integration. |
| test/Extensions/Orleans.Streaming.EventHubs.Tests/CheckpointerTests/EventHubCheckpointerTests.cs | Updates EventHub checkpointer tests and adds ordering/no-advance coverage. |
| test/Extensions/Orleans.Streaming.EventHubs.Tests/CheckpointerTests/EventHubCheckpointerConfigurationTests.cs | Adds DI/hosting tests for selecting grain vs Azure Table checkpointers. |
| src/Orleans.Streaming/QueueBalancer/PersistentStreamConfiguratorExtension.cs | Adds UseGrainCheckpointer extension on ISiloPersistentStreamConfigurator. |
| src/Orleans.Streaming/Checkpointers/StreamCheckpointerGrainState.cs | Introduces persisted grain state model for checkpoints. |
| src/Orleans.Streaming/Checkpointers/StreamCheckpointerGrain.cs | Adds grain implementations to read/write checkpoints via grain storage. |
| src/Orleans.Streaming/Checkpointers/StreamCheckpointComparers.cs | Introduces common checkpoint comparer(s), including numeric ordering. |
| src/Orleans.Streaming/Checkpointers/IStreamCheckpointerGrain.cs | Introduces grain interface for checkpoint persistence (and configured variant). |
| src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointerOptions.cs | Adds options for persistence interval, storage provider selection, and ordering. |
| src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointerFactory.cs | Adds factory for creating grain-backed checkpointers per partition. |
| src/Orleans.Streaming/Checkpointers/GrainStreamQueueCheckpointer.cs | Implements grain-backed checkpointing with throttling/flush semantics. |
| src/Azure/Orleans.Streaming.EventHubs/README.md | Documents opting into grain storage for Event Hubs checkpoints. |
| src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubStreamBuilder.cs | Adds UseGrainCheckpointer for Event Hubs stream configurator (defaults numeric ordering). |
| src/api/Orleans.Streaming/Orleans.Streaming.cs | Updates public API surface for new checkpointer/grain types/options/comparers/extensions. |
| src/api/Azure/Orleans.Streaming.EventHubs/Orleans.Streaming.EventHubs.cs | Updates Event Hubs public API surface to include UseGrainCheckpointer. |
Copilot's findings
- Files reviewed: 17/17 changed files
- Comments generated: 5
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 74f81769-0c5e-4132-82f2-6f421750f500
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 74f81769-0c5e-4132-82f2-6f421750f500
This was referenced Aug 7, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 577cd3e5-ccfb-44f2-98d5-b1953c4b8cd6
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 74f81769-0c5e-4132-82f2-6f421750f500
This was referenced Aug 28, 2026
Merged
This was referenced Aug 31, 2026
Merged
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.
Split from #8967.
Adds a provider-independent stream queue checkpointer backed by Orleans grain storage and configured through
ISiloPersistentStreamConfigurator, allowing any persistent stream provider to use it.The implementation supports per-stream-provider grain storage selection, validates that the selected keyed storage provider is registered, and uses collision-safe identities across services, stream providers, partitions, and storage providers. Checkpoint updates use compare-and-swap semantics to prevent stale writers from regressing persisted offsets.
Event Hubs can opt into the grain-backed checkpointer with numeric checkpoint ordering while retaining its existing Azure Table Storage checkpointer as the default. This also unblocks the Kinesis provider in #8967.
Follow-up: #10355 generalizes the Azure Table checkpointer and is based on this PR's head commit.