dyno icon indicating copy to clipboard operation
dyno copied to clipboard

Replication factor determination ignores inactive hosts

Open rprevot opened this issue 8 years ago • 0 comments

Hi,

When using Token Aware load balancing, the replication factor is checked during startup.

This validation is done by the HostSelectionWithFallback class (initWithHosts and calculateReplicationFactor methods):

public void initWithHosts(Map<Host, HostConnectionPool<CL>> hPools) {
       List<HostToken> allHostTokens = tokenSupplier.getTokens(hPools.keySet());
       // ....
       if (localSelector.isTokenAware() && localRack != null) {
              replicationFactor.set(calculateReplicationFactor(allHostTokens));
       }
       // ...
}

Unfortunately, the given collection "hPools" contains only up hosts. So if one host is unavailable during startup, Dyno throws an exception even for symmetric configuration.

rprevot avatar Nov 28 '17 21:11 rprevot