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

No way to disable DData.Durable with Akka.Hosting #512

Closed
Aaronontheweb opened this issue Nov 6, 2024 · 2 comments · Fixed by #527
Closed

No way to disable DData.Durable with Akka.Hosting #512

Aaronontheweb opened this issue Nov 6, 2024 · 2 comments · Fixed by #527
Labels
akka-cluster bug Something isn't working

Comments

@Aaronontheweb
Copy link
Member

Aaronontheweb commented Nov 6, 2024

I can validate that this DOES disable DData from writing to disk:

public static class DrawingSessionActorExtensions
{
    public static AkkaConfigurationBuilder AddDrawingSessionActor(this AkkaConfigurationBuilder builder,
        string clusterRoleName = ClusterConstants.DrawStateRoleName)
    {
        builder.WithShardRegion<DrawingSessionActor>("drawing-session",
                (system, registry, resolver) => s => resolver.Props<DrawingSessionActor>(s),
                new DrawingSessionActorMessageExtractor(), new ShardOptions()
                {
                    StateStoreMode = StateStoreMode.DData,
                    RememberEntities = true,
                    RememberEntitiesStore = RememberEntitiesStore.DData,
                    Role = clusterRoleName
                })
            // .WithDistributedData(options =>
            // {
            //     options.Durable = new DurableOptions() { Keys = [] }; // disable persistence
            // })
            .AddHocon("akka.cluster.sharding.distributed-data.durable.keys = []", HoconAddMode.Prepend);
        return builder;
    }
}

It looks like this is an Akka.Hosting issue with options.Durable = new DurableOptions() { Keys = [] }; // disable persistence not working as expected - and that's probably an easy fix.

Originally posted by @Aaronontheweb in akkadotnet/akka.net#7326 (comment)

@Aaronontheweb Aaronontheweb added akka-cluster bug Something isn't working labels Nov 6, 2024
Aaronontheweb added a commit to Aaronontheweb/Akka.Hosting that referenced this issue Nov 6, 2024
Aaronontheweb added a commit to Aaronontheweb/Akka.Hosting that referenced this issue Nov 6, 2024
@Arkatufus
Copy link
Contributor

Arkatufus commented Nov 19, 2024

options.Durable is not the right settings for this, this is the global DData setting ("akka.cluster.distributed-data"), not the global sharding distributed data settings ("akka.cluster.sharding.distributed-data"), those 2 settings are completely different.

@Arkatufus
Copy link
Contributor

Added a new extension method API .WithShardingDistributedData() that actually applies to the correct HOCON setting here: #527

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
akka-cluster bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants