Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
Post-Helium
-
None
-
None
-
Operating System: All
Platform: All
-
3194
-
Normal
Description
Currently the PrimaryShardInfo cache in ActorContext for findPrimaryAsync is purged after the leader election timeout. However since leadership shouldn't change often, we can maintain the cache longer by purging when leadership changes.
We'll need an actor to listen for LeaderStateChange messages and update the cache. We could create a new one and register it with every shard in some manner, it would be simpler to utilize the ShardManager which already listens for LeaderStateChange messages. We can encapsulate the map in a PrimaryShardCache instance that is published to the ShardManager actor and the ActorContext.