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

ClusterSharding should clean its internal cache if region/proxy died #6424

Merged

Conversation

Arkatufus
Copy link
Contributor

Fixes #6398

Changes

  • Shift region and proxy cache update responsibility from ClusterSharding to ClusterShardingGuardian
  • Clean cache when region/proxy actor died

@Arkatufus
Copy link
Contributor Author

Arkatufus commented Feb 21, 2023

Bugged when there are both region and proxy with the same type name, let me fix that

Copy link
Member

@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.

LGTM - pending test suite passing

@@ -302,7 +302,8 @@ public ClusterSharding(ExtendedActorSystem system)
var guardianName = system.Settings.Config.GetString("akka.cluster.sharding.guardian-name");
var dispatcher = system.Settings.Config.GetString("akka.cluster.sharding.use-dispatcher");
if (string.IsNullOrEmpty(dispatcher)) dispatcher = Dispatchers.InternalDispatcherId;
return system.SystemActorOf(Props.Create(() => new ClusterShardingGuardian()).WithDispatcher(dispatcher), guardianName);
return system.SystemActorOf(Props.Create(() => new ClusterShardingGuardian(_regions, _proxies))
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@@ -118,6 +119,31 @@ private IActorRef StartProxy(ActorSystem sys)
return ClusterSharding.Get(sys).StartProxy(shardTypeName, null, extractEntityId, extractShardId);
}

[Fact(DisplayName = "ClusterSharding must clean up its internal regions cache when ShardRegion actor died")]
public void ClusterShardingDeadShardRegionTest()
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) February 21, 2023 20:48
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.

ClusterShardRegion of 1.5 Alpha version unable to restart
2 participants