I think we don't want to differentiate different remote colos. We only care about the success in local replicas and one remote replicas. For that, we can create two different set of replicas, one for local replicas, one for remote.
So the map replicaByDc can have two keys, "LOCAL" and "REMOTE", or just "true" or "false" to indicate if it's local or remote.
For the remote replicas, we also want to make sure that we get leaders and standbys, so we still need to call getEligibleReplicas to get the leader and standby replicas from the remote.
I think we don't want to differentiate different remote colos. We only care about the success in local replicas and one remote replicas. For that, we can create two different set of replicas, one for local replicas, one for remote.
So the map
replicaByDc
can have two keys, "LOCAL" and "REMOTE", or just "true" or "false" to indicate if it's local or remote.For the remote replicas, we also want to make sure that we get leaders and standbys, so we still need to call getEligibleReplicas to get the leader and standby replicas from the remote.