dotnet / orleans

Cloud Native application framework for .NET
https://docs.microsoft.com/dotnet/orleans
MIT License
10.06k stars 2.03k forks source link

Question/Suggestion: What would it take to make streams versioned like grain interfaces? #8188

Open MarkNickeson opened 1 year ago

MarkNickeson commented 1 year ago

The basic idea is to enable graceful relocation of "internal streaming state" from Version N to Version N+1 silos, avoiding overt disruption associated with shutdown of silos housing active "internal streaming state".

Explicitly: this is not about versioning message state residing within streams.

Ideally:

Thank you!

ReubenBond commented 9 months ago

It's an interesting idea. Placement is currently based on interfaces, but this could be implemented today using a custom attribute on a grain to add a "version" property to the GrainProperties in the ClusterManifest and then when you encounter a message which is intended for a newer version you would call MigrateOnIdle() with a placement hint to migrate the grain to a new silo programmatically, setting the target's SiloAddress in the RequestContext via RequestContext.Set(IPlacementDirector.PlacementHintKey, targetHost). The target silo would be discovered by finding a compatible silo in the ClusterManifest. From the new grain, you would resume stream processing. This functionality could be wrapped up in a more user-friendly interface. We'd need a proposal for that.