Repository navigation
fix(streaming): recover Event Hubs from stale checkpoints #7464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
oising
wants to merge
31
commits into
dotnet:main
Choose a base branch
from
oising:gh-7256-pulling-agent-checkpoint-outofbounds
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,994
−621
Open
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
5b36e2b
add Reset() method to IStreamQueueCheckpointer
oising 039c4e8
fix(streaming): harden stale checkpoint recovery
ReubenBond c115797
fix(streaming): propagate checkpoint cancellation
ReubenBond 03ef0eb
docs(streaming): explain Event Hubs checkpoint recovery
ReubenBond a08d634
fix(streaming): honor checkpointer semantics
ReubenBond c498705
fix(streaming): complete cache recovery contracts
ReubenBond fa6a4c7
fix(streaming): honor canceled checkpointer operations
ReubenBond 02d8803
fix(streaming): honor all checkpointer cancellations
ReubenBond 1990c7a
fix(streaming): preserve current stream contracts
ReubenBond 249c8b9
fix(azure): propagate storage cancellation
ReubenBond 881531c
fix(streaming): align Event Hubs diagnostics
ReubenBond 938a3a6
fix(streaming): obsolete legacy checkpointer factories
ReubenBond ff70b14
fix(streaming): isolate Azure checkpoint writes
ReubenBond 933cc94
fix(streaming): adapt checkpoint recovery to typed cursors
ReubenBond 5520a12
fix(streaming): distinguish checkpoint recovery failures
ReubenBond b98ce8b
fix(streaming): preserve pending cache misses
ReubenBond 065ce00
fix(streaming): reconcile checkpoint resets with main
ReubenBond 3d81a0d
fix(streaming): close checkpoint recovery races
ReubenBond d7aa4e5
test(streaming): await Event Hubs cache initialization
ReubenBond 7daeeb7
test(streaming): await Event Hubs purge setup
ReubenBond cf20abb
fix(streaming): serialize Event Hubs recovery
ReubenBond ca93fc8
fix(streaming): harden checkpoint recovery cleanup
ReubenBond ddc731d
fix(streaming): reject progress while recovering
ReubenBond c692bf1
fix(streaming): serialize receiver initialization
ReubenBond 8e17aaf
fix(streaming): retain failed initialization cleanup
ReubenBond 3fdac89
fix(streaming): keep reset recovery in flight
ReubenBond 0163ee9
fix(streaming): preserve recovery after reset failure
ReubenBond ac25afa
fix(streaming): propagate receiver initialization cancellation
ReubenBond eeb9c05
fix(streaming): drain Event Hubs receiver lifetimes
ReubenBond b163790
fix(streaming): serialize receiver lifetime transitions
ReubenBond 455f039
Merge branch 'main' into gh-7256-pulling-agent-checkpoint-outofbounds
oising File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
83 changes: 40 additions & 43 deletions
83
...rleans.Streaming.EventHubs/Providers/EventDataGeneratorStreamProvider/NoOpCheckpointer.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,49 @@ | ||
| using Orleans.Streams; | ||
| using System; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using Orleans.Streams; | ||
|
|
||
| namespace Orleans.Streaming.EventHubs.Testing; | ||
|
|
||
| namespace Orleans.Streaming.EventHubs.Testing | ||
| public class NoOpCheckpointerFactory : IStreamQueueCheckpointerFactory | ||
| { | ||
| /// <summary> | ||
| /// Creates checkpointers which keep no persistent checkpoint state. | ||
| /// </summary> | ||
| public class NoOpCheckpointerFactory : IStreamQueueCheckpointerFactory | ||
| public static NoOpCheckpointerFactory Instance = new NoOpCheckpointerFactory(); | ||
|
|
||
| [Obsolete("Use the overload which accepts a CancellationToken.")] | ||
| public Task<IStreamQueueCheckpointer<string>> Create(string partition) | ||
|
ReubenBond marked this conversation as resolved.
Resolved
|
||
| => Create(partition, CancellationToken.None); | ||
|
|
||
| public Task<IStreamQueueCheckpointer<string>> Create( | ||
| string partition, | ||
| CancellationToken cancellationToken) | ||
| => cancellationToken.IsCancellationRequested | ||
| ? Task.FromCanceled<IStreamQueueCheckpointer<string>>(cancellationToken) | ||
| : Task.FromResult<IStreamQueueCheckpointer<string>>(NoOpCheckpointer.Instance); | ||
| } | ||
| /// <summary> | ||
|
Comment on lines
+22
to
+23
|
||
| /// NoOpCheckpointer is used in EventDataGeneratorStreamProvider ecosystem to replace the default Checkpointer which requires a back end storage. In EventHubDataGeneratorStreamProvider, | ||
| /// it is generating EventData on the fly when receiver pull messages from the queue, which means it doesn't support recoverable stream, hence check pointing won't bring much value there. | ||
| /// So a checkpointer with no ops should be enough. | ||
| /// </summary> | ||
| public class NoOpCheckpointer : IStreamQueueCheckpointer<string> | ||
| { | ||
| public static NoOpCheckpointer Instance = new NoOpCheckpointer(); | ||
|
|
||
| public bool CheckpointExists => false; | ||
| public Task<string> Load() | ||
| { | ||
| /// <summary> | ||
| /// Gets the shared factory instance. | ||
| /// </summary> | ||
| public static NoOpCheckpointerFactory Instance = new NoOpCheckpointerFactory(); | ||
|
|
||
| /// <inheritdoc /> | ||
| public Task<IStreamQueueCheckpointer<string>> Create(string partition) | ||
| { | ||
| return Task.FromResult<IStreamQueueCheckpointer<string>>(NoOpCheckpointer.Instance); | ||
| } | ||
| return Task.FromResult(EventHubConstants.StartOfStream); | ||
| } | ||
| /// <summary> | ||
| /// NoOpCheckpointer is used in EventDataGeneratorStreamProvider ecosystem to replace the default Checkpointer which requires a back end storage. In EventHubDataGeneratorStreamProvider, | ||
| /// it is generating EventData on the fly when receiver pull messages from the queue, which means it doesn't support recoverable stream, hence check pointing won't bring much value there. | ||
| /// So a checkpointer with no ops should be enough. | ||
| /// </summary> | ||
| public class NoOpCheckpointer : IStreamQueueCheckpointer<string> | ||
|
|
||
| [Obsolete("Use the overload which accepts a CancellationToken.")] | ||
| public Task Reset() => Task.CompletedTask; | ||
|
|
||
| public Task Reset(CancellationToken cancellationToken) | ||
| => cancellationToken.IsCancellationRequested | ||
| ? Task.FromCanceled(cancellationToken) | ||
| : Task.CompletedTask; | ||
|
|
||
| public void Update(string offset, DateTime utcNow) | ||
| { | ||
| /// <summary> | ||
| /// Gets the shared checkpointer instance. | ||
| /// </summary> | ||
| public static NoOpCheckpointer Instance = new NoOpCheckpointer(); | ||
|
|
||
| /// <inheritdoc /> | ||
| public bool CheckpointExists => true; | ||
|
|
||
| /// <inheritdoc /> | ||
| public Task<string> Load() | ||
| { | ||
| return Task.FromResult(EventHubConstants.StartOfStream); | ||
| } | ||
| /// <summary> | ||
| /// Ignores a checkpoint update because generated-event streams do not persist checkpoints. | ||
| /// </summary> | ||
| /// <param name="offset">The ignored offset.</param> | ||
| /// <param name="utcNow">The ignored update time.</param> | ||
| public void Update(string offset, DateTime utcNow) | ||
| { | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.