I am using Stateful service. I have requirement where I have to run long running task which will keep updating the state and store in StateManager. But I observed that , in cluster when I deactivate primary node, the service fabric automatically spin up the new node as a primary node, but the newly created primary node doesnt have the state which is previously stored. So am I missing anything or it is expected behaviour?
Asked
Active
Viewed 101 times
0
-
1If you mention the code here community can help. You might want to mention other details as well. It is very unlikely that the stateful service fabric service misses you state. Here https://channel9.msdn.com/Shows/Cloud+Cover/Episode-210-Service-Fabric-Series-1-of-3-Introduction is the demonstration that when you deactivate the primary node, secondary node becomes the primary but does not miss any data/state. – Shridhar R Kulkarni Sep 20 '17 at 10:26
-
1We'd need to take a look at your code. Properly used, the state is always available when a primary fails over to a new node. Maybe you're not committing your transactions? – Vaclav Turecek Sep 20 '17 at 18:24
-
You mention spin up new node. That should not how service fabric stateful works. You already have one primary and two replica and when primary deactivated then replica will be promoted with your current state. – duongthaiha Sep 22 '17 at 21:52