Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computes replication factor for complete topology (active and inactive hosts) #203

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rprevot
Copy link
Contributor

@rprevot rprevot commented Feb 7, 2018

Pull Request for issue #195

@shailesh33
Copy link
Contributor

@rprevot First off, I am unable to reproduce this problem. I have a 3 node cluster in a single dc, 1 node per rack. I took down one node in a rack and inited the client and it worked fine.
Also the initWithHosts takes a subset of nodes that are active (UP) but it does try to get all the hosts and token mappings using the token map supplier. So I am not sure if taking all the hosts into account vs some hosts makes any difference. Maybe I am missing something.

@rprevot
Copy link
Contributor Author

rprevot commented Mar 2, 2018

Sorry for the delay ...

You can reproduce the issue on current master version (1.6.3-SNAPSHOT) :

  • To enable replication factor checking, you must use local zone affinity and define a local rack.
  • To encounter asymmetric topology error, the number of nodes per rack must be greater than 1.
  • TokenMapSupplier.getTokens(final Set activeHosts) must provide tokens for given hosts only.

I've got the following stacktrace:

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Invalid configuration - replication factor cannot be asymmetric
	at com.netflix.dyno.jedis.DynoJedisClient$Builder.startConnectionPool(DynoJedisClient.java:4059)
	at com.netflix.dyno.jedis.DynoJedisClient$Builder.createConnectionPool(DynoJedisClient.java:4031)
	at com.netflix.dyno.jedis.DynoJedisClient$Builder.buildDynoJedisClient(DynoJedisClient.java:4007)
	at com.netflix.dyno.jedis.DynoJedisClient$Builder.build(DynoJedisClient.java:3936)
	at com.nsn.ipsdb.client.TestDyno.main(TestDyno.java:123)
Caused by: java.lang.RuntimeException: Invalid configuration - replication factor cannot be asymmetric
	at com.netflix.dyno.connectionpool.impl.lb.HostSelectionWithFallback.calculateReplicationFactor(HostSelectionWithFallback.java:393)
	at com.netflix.dyno.connectionpool.impl.lb.HostSelectionWithFallback.initWithHosts(HostSelectionWithFallback.java:353)
	at com.netflix.dyno.connectionpool.impl.ConnectionPoolImpl.initSelectionStrategy(ConnectionPoolImpl.java:627)
	at com.netflix.dyno.connectionpool.impl.ConnectionPoolImpl.start(ConnectionPoolImpl.java:526)
	at com.netflix.dyno.jedis.DynoJedisClient$Builder.startConnectionPool(DynoJedisClient.java:4042)
	... 4 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants