-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Orleans Version - 3.7.1
Clustering Method used - Redis Clustering
### Issue Description -
While building SiloHost and Cluster Client, RedisClustering established connection with Gateway/Proxy (here 22227) port instead of SiloPort (here 11116). Verify from Logs provided below which shows grains are activated on proxy port Not on the silo port. Redis database doesn't have entry for gateway/proxy port as a Key e.g. S127.0.0.1:22227:455333738.
Redis database membershiptable has entry for siloport as a Key e.g. S127.0.0.1:11116:455333738
Hence activation of grain on Gateway/Proxy port and Redis NOT having Key entry for Proxy port the Error displayed as -
1.fail: Orleans.Runtime.MembershipService.LocalSiloHealthMonitor[0]
Could not find a membership entry for this silo
2.Orleans.Runtime.MembershipService.MembershipAgent[100659]
Failed to update table entry for this silo, will retry shortly: Orleans.Clustering.Redis.RedisClusteringException: Could not find a value for the key S127.0.0.1:22227:455333738
Code for Clustering -
// Define the cluster configuration
1. SiloHost Builder-
var builder = new SiloHostBuilder()
.Configure(options =>
{
options.ClusterId = "RedisCluster"; // Unique ID for the Orleans cluster
options.ServiceId = "SiloHostService"; // Unique ID for your application
})
.ConfigureEndpoints(IPAddress.Loopback, siloPort: 11116, gatewayPort: 22227)
.AddMemoryGrainStorageAsDefault()
.UseRedisClustering(opt =>
{
opt.ConnectionString = "localhost:6379";
opt.Database = 0;
})
this._siloHost = builder.Build();
2. ClientBuilder -
var clientBuilder = new ClientBuilder()
.Configure(options =>
{
options.ClusterId = "RedisCluster"; // Unique ID for the Orleans cluster
options.ServiceId = "SiloHostService"; // Unique ID for your application
})
//RedisClustering
.UseRedisClustering(opt =>
{
opt.ConnectionString = "localhost:6379";
opt.Database = 0;
})
client = clientBuilder.Build();
client.Connect().Wait();
Redis DB details after SiloHost build are -
127.0.0.1:6379> hgetall SiloHostService/RedisCluster
- "Version"
- "2"
3) "S127.0.0.1:11116:455331984" - "{"SiloAddress":{"SiloAddress":"127.0.0.1:11116@455331984"},"Status":3,"SuspectTimes":[],"ProxyPort":22227,"HostName":"ADESHMUKH11","SiloName":"Silo_5ae8e","RoleName":"ResAppService","UpdateZone":0,"FaultZone":0,"StartTime":"2024-06-06T01:06:25.3640819Z","IAmAliveTime":"2024-06-06T01:06:26.8485889Z"}"
Logs from SiloHost builder and Client builder
info: Orleans.Runtime.MembershipService.MembershipTableManager[100645]
ProcessTableUpdate (called from TryUpdateMyStatusGlobalOnce) membership table: 1 silos, 1 are Active, 0 are Dead, Version=<2, 1>. All silos: [SiloAddress=S127.0.0.1:11116:455333738 SiloName=Silo_eb448 Status=Active]
info: Orleans.Runtime.MembershipService.MembershipAgent[100605]
-Finished BecomeActive.
info: Orleans.Runtime.Messaging.Gateway[101301]
Recorded opened connection from endpoint 127.0.0.1:55862, client ID cli/c6a40a83.
warn: Orleans.Runtime.Scheduler.WorkItemGroup[101215]
Task [Id=668, Status=RanToCompletion] in WorkGroup [Activation: S127.0.0.1:22227:455333738grn/Grain/0+ENV_Silo1@f88ed58f #GrainType=SGrainPlacement=StatelessWorkerPlacement State=Valid] took elapsed time 0:00:00.3158179 for execution, which is longer than 00:00:00.2000000. Running on thread 37
SessionTransThreadId #36 of: 1
warn: Orleans.Runtime.Scheduler.WorkItemGroup[101215]
Task [Id=613, Status=RanToCompletion] in WorkGroup [Activation: S127.0.0.1:22227:455333738grn/Grain/0+WebClient_Silo1@5ba23781 #GrainType=FHGrain Placement=RandomPlacement State=Valid] took elapsed time 0:00:00.5403523 for execution, which is longer than 00:00:00.2000000. Running on thread 11
info: Orleans.Providers.Streams.SimpleMessageStream.SimpleMessageStreamProvider[0]
Initialized SimpleMessageStreamProvider with name MessageStreamProvider and with property FireAndForgetDelivery: False, OptimizeForImmutableData: True and PubSubType: ExplicitGrainBasedAndImplicit
info: Orleans.Storage.MemoryGrainStorage[0]
Init: Name=PubSubStore NumStorageGrains=10
info: Orleans.Storage.MemoryStorageGrain[0]
OnActivateAsync
SessionTransThreadId #5 of: 1