Description
1) Currently, the function iterates through an array of connectionstr as a rotating buffer at random starting point. The code could be more streamline if there is a utility that returned a random-swapped connectionstr array. refresh() function can then just simply iterate through this array.
2) replaceRefHostName() share a lot of code path with refresh(). And replaceRefHostName() is only called from refresh(). We need to see why we have to (seemingly) repeating some of the work twice. Specifiically, why the nodeList retrieved inside refresh() is not sufficient to update ref.HostName (and we need a separate function to update replaceRefHostName).
3) We also have to find out why we need to periodically refresh remoteClusterRef. Shouldn't refresh be driven from target topology change (on demand).