dotnet / orleans

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

About when the silo stops #5040

Closed summitn closed 5 years ago

summitn commented 6 years ago

I started silo s1 and s2, client c1 and c2 connect silo s1 and subscribe. Then turn off silo s1, c1 and c2 subscribed grains to s2, c1 and c2 need to re-subscribe to the previous grain but c1 and c2 don't know. How should this be solved?! I'm sorry about the English ~

sergeybykov commented 6 years ago

Clients c1 and c2 should connect to both s1 and s2. By default, that happens automatically but it may take a few calls to grains from clients for those connections to get established.

summitn commented 6 years ago

I mean C1, C2 and S1, S2 has established a connection and subscribed to the stream. At this time, S1 is closed by me. When C1 or C2 calls the grain again, R1 is transferred to S2. C1 and C2 can send messages, S2. You can also receive the message, but the previously subscribed stream is no longer valid and needs to be re-subscribed, but C1, C2 don't know that S1 is closed, and you don't need to re-subscribe the stream.

sergeybykov commented 6 years ago

What is R1? What version of Orleans are you running?

summitn commented 6 years ago

r1 is grain instance,version is 2.1.0

summitn commented 6 years ago

Look at the examples in the example project, orleans/Samples/2.0/ChatRoom/

sergeybykov commented 6 years ago

Can you share your exact code? The ChatRoom sample uses an unreliable clustering option:

.UseLocalhostClustering()

and an unreliable pubsub configuration:

.AddMemoryGrainStorage("PubSubStore")

This is sufficient for a basic sample, but not for the kind of reliability testing that you are trying to do. For that you need to use reliable clustering and storage providers.

summitn commented 6 years ago

I just started learning the Orleans framework, so I don't know much about it. The specific code is the chat room example.Because the English is not good, the documentation seems to be old, and the API has changed, so look at the example to learn.Thank you for your help!

summitn commented 6 years ago

Can you tell me what apis are used for stable clusters and streams. And how does the .ConfigureLogging() use itself.

sergeybykov commented 6 years ago

Have you found http://dotnet.github.io/orleans/Documentation/clusters_and_clients/configuration_guide/typical_configurations.html documentation page that provides examples of reliable cluster configurations?

summitn commented 6 years ago

Thanks for your help. I found related documents for clustering and streaming. I think I should read more documents.