-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix how ClusterShardingSettings were applied #480
Fix how ClusterShardingSettings were applied #480
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some suggestions
@@ -850,7 +874,7 @@ public static class AkkaClusterHostingExtensions | |||
IMessageExtractor messageExtractor, | |||
ShardOptions shardOptions) | |||
{ | |||
shardOptions.Apply(builder); | |||
shardOptions.DistributedData.Apply(builder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just don't worry about DData settings. Please remove this entirely from the API. Let users configure DData separately if needed. Only stick to what's in the ClusterShardingSetting
s class for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how would the user set the akka.cluster.sharding.distribute-data
settings then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a situation arises where they would ever need to do it, they can do it through HOCON.
…a.Hosting into fix-cluster-sharding-setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but add a regression spec to verify that two different ShardRegions in the same node can be configured with separate:
- Remember entities
- Passivization settings
- Roles
You don't need to end2end this spec - just testing the ClusterShardingSettings
output produced by consuming the shardOptions.ToConfig()
should be fine.
var coordinatorConfig = system.Settings.Config.GetConfig( | ||
shardingConfig.GetString("coordinator-singleton")); | ||
|
||
var settings = ClusterShardingSettings.Create(shardingConfig, coordinatorConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #477
Previously, settings were applied directly to the HOCON configuration, setting up a cluster shard region using
ShardOptions
would not work because only the lastShardOptions
would be applied to the HOCON configuration.Changes
ShardOptions
to be applied separately perWithShardRegion()
call.Note
Distributed data settings for all shard regions are still stored as a single HOCON setting (
akka.cluster.sharding.distributed-data
), they are not applied on a per region basis.