Hello Alexey Serbin, Anonymous Coward #314,

I'd like you to do a code review. Please visit


to review the following change.

Change subject: KUDU-2343. java: properly reconnect to new leader master after 

KUDU-2343. java: properly reconnect to new leader master after failover

This fixes the connection cache in the java client to be based on IP
address and port rather than based on UUID. We don't currently use the
master UUIDs in the Java client, so the connections to all masters were
getting conflated in the cache. This would cause the client to reconnect
back to a follower master even if the leader had changed and even if it
had properly identified the address of the new leader.

An existing test which tested killing a master now runs in a second mode
which restarts the master. This reproduced the bug prior to the fix.
This patch also cleans up that test somewhat - it was doing some buggy
logic to attempt to kill more than one tablet server, but in fact just
called "killTabletServer" three times on the same one. Killing three
tablet servers never made sense, either, since the table in the test
only had three replicas. Neither did it make sense to start six tablet
servers for the test.

Along the way, this patch also improves toString() output for a number
of Java client structures. This makes it easier to debug
Connection-level issues.

Change-Id: I36f96c6712800e398ed46887d97d4b09fd993b04
M java/kudu-client/src/main/java/org/apache/kudu/client/Connection.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ConnectionCache.java
M java/kudu-client/src/main/java/org/apache/kudu/client/RemoteTablet.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ServerInfo.java
M java/kudu-client/src/main/java/org/apache/kudu/client/TableLocationsCache.java
M java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestRemoteTablet.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestServerInfo.java
9 files changed, 105 insertions(+), 37 deletions(-)

  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/12/9612/1
To view, visit http://gerrit.cloudera.org:8080/9612
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I36f96c6712800e398ed46887d97d4b09fd993b04
Gerrit-Change-Number: 9612
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Anonymous Coward #314

Reply via email to