joao-r-reis commented on issue #1873: URL: https://github.com/apache/cassandra-gocql-driver/issues/1873#issuecomment-2778459091
> @joao-r-reis you might have more experience with how other drivers handle this. Thoughts? Most drivers use maps with ip addresses as keys but java driver 4.x moved to using host ids as the keys. Usually the behavior is to go through the new list of `localhost + peer hosts` one by one and add the host to the map if there is no entry or update the entry if it already exists. In the case of the java driver they have special handling for cases where there the same host id already exists under a different IP which happens in C* when a node changes its IP but this case will also fix the aws keyspaces issue I believe: https://github.com/apache/cassandra-java-driver/blob/529d56e1742dcd1df3ca55c00fd8e02c0e484c68/core/src/main/java/com/datastax/oss/driver/internal/core/metadata/AddNodeRefresh.java#L43-L66 GoCQL has both maps but it uses the map by host id for these checks. > I think inside func (r *ringDescriber) GetHosts() we shouldn't blindly just be doing append([]*HostInfo{localHost}, peerHosts...) `GetHosts()` just returns all the hosts found in system tables without additional logic so I think it should be kept as is and changes should be made to `func refreshRing(r *ringDescriber) error` instead. Reading through `refreshRing` function I'd think that the aws keyspaces case would not be an issue because it starts with the local host as it is iterating through the slice and then when it reaches the peer host with the same host id it should update the IPs... Maybe there's some bug here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org