Thanks Naba & Jacob for your comments!
@Naba: I have been implementing a solution as you suggested, and I think it would be convenient if the client knows the memberId of the server it is connected to. (current code is here: https://github.com/apache/geode/pull/4616 ) For example, in: LocatorLoadSnapshot::getReplacementServerForConnection(ServerLocation currentServer, String group, Set<ServerLocation> excludedServers) In this method, client has sent the ServerLocation , but if that object does not contain the memberId, I dont see how to guarantee that the replacement that will be returned is not the same server the client is currently connected. Inside that method, this other method is called: LocatorLoadSnapshot::isCurrentServerMostLoaded(currentServer, groupServers) where groupServers is a "Map<ServerLocationAndMemberId, LoadHolder>" object. If the keys of that map have the same host and port, they are only different on the memberId. But as you dont know it (you just have currentServer which contains host and port), you cannot get the correct LoadHolder value, so you cannot know if your server is the most loaded. So I think client needs to know the memberId of the server. @Jacob: I think the solution finally implies that client have to know the memberId, I think we could simplify the maps. BR/ Alberto B. ________________________________ De: Jacob Barrett <jbarr...@pivotal.io> Enviado: miƩrcoles, 22 de enero de 2020 7:29 Para: dev@geode.apache.org <dev@geode.apache.org> Cc: Anilkumar Gingade <aging...@pivotal.io>; Charlie Black <cbl...@pivotal.io> Asunto: Re: WAN replication issue in cloud native environments > On Jan 21, 2020, at 1:24 PM, Nabarun Nag <n...@apache.org> wrote: > > Suggestion: > - Instead, can we create a new class that contains the memberID and > ServerLocation and that new class object is added as a key in the > connectionMap. I poked around a bit in this code and the ServerLocation is also in the LoadHolder class so we can simplify this even more by just using the member ID as the key in all these maps. When we need the ServerLocation we can get that from the LoadHolder. The addServer call comes from a caller that has the CacheServerProfile, which has the member ID. The updateLoad caller is a DistributedMessage which has a sender member that is the member ID. Lastly, removeServer caller has a CacheServerProfile as well we can again get the member ID. -Jake