Skip to content
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

Added spec to demonstrate failed snapshot-only recovery #6822

Conversation

Aaronontheweb
Copy link
Member

@Aaronontheweb Aaronontheweb commented Jun 28, 2023

Changes

Tests whether a persistent actor will properly fail during a failed snapshot recovery or during a timed out one. This is all without ever having saved an event to the journal, so the MaxSeqNo is set to 0.

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

Tests whether a persistent actor will properly fail during a failed snapshot recovery or during a timed out one. This is all without ever having saved an event to the journal, so the `MaxSeqNo` is set to `0`.
Copy link
Member Author

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detailed my changes - ultimately this was more about testing a theory on behalf of a customer. No real structural changes to any Akka.NET modules.

@@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyTitle>Akka.Persistence.TestKit</AssemblyTitle>
<Description>TestKit for writing tests for Akka.NET Persistance module.</Description>
<TargetFrameworks>$(NetStandardLibVersion)</TargetFrameworks>
<TargetFrameworks>$(NetStandardLibVersion);$(NetLibVersion)</TargetFrameworks>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added dual-targeting to the Akka.Persistence.TestKit (net6)

@@ -8,6 +8,7 @@

<ItemGroup>
<ProjectReference Include="..\..\contrib\serializers\Akka.Serialization.Hyperion\Akka.Serialization.Hyperion.csproj" />
<ProjectReference Include="..\Akka.Persistence.TestKit.Xunit2\Akka.Persistence.TestKit.Xunit2.csproj" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Referenced the Akka.Persistence.TestKit so I could more easily simulate journal / snapshot store failures

{
var actor2 = Sys.ActorOf(Props.Create(() => new PersistentActor("p1", probe.Ref)));
Watch(actor2);
await probe.ExpectNoMsgAsync();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not receive an SnapshotSaved here as the actor will not successfully complete recovery under either scenario.

var actor2 = Sys.ActorOf(Props.Create(() => new PersistentActor("p1", probe.Ref)));
Watch(actor2);
await probe.ExpectNoMsgAsync();
await ExpectTerminatedAsync(actor2);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actor should have self-terminated by now.

Copy link
Contributor

@Arkatufus Arkatufus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Arkatufus Arkatufus merged commit 52cf479 into akkadotnet:dev Jun 29, 2023
@Aaronontheweb Aaronontheweb deleted the added-failed-snapshot-only-recovery-spec branch June 29, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants