datastax/java-driver — pull request #55 by joaquincasares (2013-04-03 21:44:59+00:00)
Title: JAVA-62 - DCAwareRoundRobinPolicy does not failover properly

https://datastax-oss.atlassian.net/browse/JAVA-62

The first issue occurs when the `idx` chooses the host different from the first, instead of the first host, since the list of `remoteHosts` is from 0 to `usedHostsPerRemoteDc`.

The second issue occurs when nodes are not removed properly. When nodes are removed, distances of `h` should be recalculated and added. Instead `h`'s distance was recalculated, but `host` was added.

At line 205 of the test, we may see errors in the future due to how the ordering of the remote dc's work, but I haven't seen any changes in all my runs.