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

Akka.Cluster.Sharding: enable prefer-oldest by default on Replicator #7290

Merged
merged 5 commits into from
Jul 22, 2024

Conversation

Aaronontheweb
Copy link
Member

@Aaronontheweb Aaronontheweb commented Jul 22, 2024

Changes

Partially resolves #6973 - this change should have been made as part of #5146 originally

Checklist

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

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

@@ -297,7 +297,7 @@ public sealed class StartProxy : INoSerializationVerificationNeeded
});
}

private ReplicatorSettings GetReplicatorSettings(ClusterShardingSettings shardingSettings)
internal static ReplicatorSettings GetReplicatorSettings(ClusterShardingSettings shardingSettings)
Copy link
Member Author

Choose a reason for hiding this comment

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

Made this internal in order to make it easy to test the real ReplicatorSettings that we're passing into DData - straight from the source.

// only populated when remember-entities is enabled
replicatorSettings.DurableKeys.Should().BeEmpty();
replicatorSettings.MaxDeltaElements.Should().Be(5);
replicatorSettings.PreferOldest.Should().BeTrue();
Copy link
Member Author

Choose a reason for hiding this comment

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

Detect whether or not PreferOldest is enabled.

@@ -207,6 +207,9 @@ akka.cluster.sharding {
distributed-data {
# minCap parameter to MajorityWrite and MajorityRead consistency level.
majority-min-cap = 5

# ShardCoordinator is singleton running on oldest
prefer-oldest = on
Copy link
Member Author

Choose a reason for hiding this comment

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

prefer-oldest should have been enabled for the DDataShardCoordinator when #5146 was originally introduced, but I overlooked it. This should play a key factor in #6973 - where LWWRegister data from the DDataShardCoordinator is going missing when the coordinator is pushing updates as it's exiting the cluster.

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 enabled auto-merge (squash) July 22, 2024 18:25
@Arkatufus Arkatufus merged commit f7f9078 into akkadotnet:dev Jul 22, 2024
12 checks passed
@Aaronontheweb Aaronontheweb deleted the refactor-sharding-settings branch July 22, 2024 18:30
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.

Akka.Cluster.Sharding: duplicate shards / entities
2 participants