Skip to content

Bugs with load balancer [JIRA: CLIENTS-657] #572

@jenafermiller

Description

@jenafermiller

Connects to basho/riak-clients#1

When customers are using a load balancer, the load balancer can add and remove IP’s dynamically. When an IP is removed, the Riak client fails in two subtle ways.

  • If the previous connect was created less than DNSTTL timespan ago, the Java client gets another connection. If it is more then a full process of doing a DNS check and getting a connection is followed. If an IP has been dynamically changed in the “less than” timespan, issues arise.
  • If a domain name is being used, the Java client gets only the IP addresses for it on RiakNode:start. If the load balancer changes IP address, the InetSocketAddress is never updated as the Java client never does another DNS lookup for the domain name case, meaning we never know if the IP address changes.

One customer implemented a fix in their system by changing the doGetConnection() method in the following way:

InetSocketAddress socketAddress = new InetSocketAddress(remoteAddress, port);

bootstrap.handler(new RiakChannelInitializer(this))

.remoteAddress(socketAddress);

Before this call:

ChannelFuture f = bootstrap.connect();

Additionally, the fix included adding the java opt -Dsun.net.inetaddr.ttl=10.

This fix has been tested by @A1 although, of course, other fixes may be possible.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions