Grant Henke has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/16941


Change subject: KUDU-3205: Fix building scan tokens when tablet not found 
errors occur
......................................................................

KUDU-3205: Fix building scan tokens when tablet not found errors occur

When tablet not found errors occur AsyncKuduClient.invalidateTabletCache
is called which then calls RemoteTablet.removeTabletClient to remove
a server (by uuid) from the RemoteTablet tabletServers list. This means that
the RemoteTablet can have a replica returned from RemoteTablet.getReplicas
which has a server that is not returned by RemoteTablet.getTabletServersCopy.
This results in a NPE when building a scan token because there is no matching
server for the replica in the serverIndexMap.

To fix this I simply check if the serverIndex found via the serverIndexMap is
null and ignore that replica if it is. A better long term fix is likely to build
the server info from the replicas themself, or to change the RemoteTablet 
behavior
to blacklist servers instead of removing them from the actual tabletServers 
list, or
to also remove the replica itself when RemoteTablet.removeTabletClient is 
called.
I didn’t do any of these options now because they are all larger changes with a
wider potential impact.

Change-Id: I68679dee1ad7ebca405dd6e086770f3e034e310c
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
M java/kudu-client/src/main/java/org/apache/kudu/client/KuduScanToken.java
M java/kudu-client/src/main/java/org/apache/kudu/client/RemoteTablet.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestScanToken.java
4 files changed, 62 insertions(+), 7 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I68679dee1ad7ebca405dd6e086770f3e034e310c
Gerrit-Change-Number: 16941
Gerrit-PatchSet: 1
Gerrit-Owner: Grant Henke <granthe...@apache.org>

Reply via email to