public override Task <NewPropagatorReply> NewPropagator(NewPropagatorRequest request, ServerCallContext context) { WaitUnfreeze(); _gigaStorage.NewPropagator(request.ServerId, request.PartitionId); return(Task.FromResult(new NewPropagatorReply { // Empty message as ack })); }
//Notifies all other servers that a new servers belongs to partition public void NotifyPropagator(string new_server, string partition) { foreach (KeyValuePair <string, PropagateClient> server in _clients) { // Ignore current server, new server and downed servers if (server.Key == ServerId || server.Key == new_server || _down[server.Key]) { continue; } Console.WriteLine("Notifying server: " + server.Key + " that server: " + new_server + " now belongs to partition: " + partition); NewPropagatorRequest newPropagatorRequest = new NewPropagatorRequest { ServerId = new_server, PartitionId = partition }; server.Value.NewPropagator(newPropagatorRequest); } }