dapr / dapr/dotnet-sdk

Internal Actor cache not invalidated after rebalance

Open
#986 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
378
Avg merge
1d 22h
Merged PRs (30d)
5

Description

Question around Actors (using Dapr 1.7):

I'm having an actor type distributed across multiple pods. At some point daprd sidecar fails on one pod, after which Placement will failover the Actor to a different pod.
As soon as the daprd sidecar is up and running on the original pod, it's deactivated on the new pod and resumes working on the original pod.
This works great, BUT there is a slight issue with using Actor State (Redis) and dotnet SDK.
Namely dotnet StateManager appears to be tracking state internally as well (caching it).
So, if some state changes happen with Actor running on the second pod, this is not reflected in the original pod's cache as it just resumes from the cache.

To address that, I assume I need to clear the internal cache each time I try to retrieve something (did not notice any configuration setting to disable this internal caching)
The other option would be for the Placement to continue using the Actor on the new pod but I don't see any configuration to do that.

Am I missing something here?

tldr;

1. The original actor host's sidecar dies but the app remains active
2. A new host comes up for the actor ID
3. Some state change happens
4. The original host returns and rebalances
5. The original host app's cache doesn't invalidate/refresh so it uses old data

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.