You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by tm...@apache.org on 2018/05/31 15:17:19 UTC
impala git commit: IMPALA-7091: Address NullPointerException in
HBaseTable.getRegionSize().
Repository: impala
Updated Branches:
refs/heads/master fdd9d059c -> fc0c5f58f
IMPALA-7091: Address NullPointerException in HBaseTable.getRegionSize().
It's possible for "serverLoad.getRegionsLoad().get(info.getRegionName())"
to be null, which causes a NullPointerException in the planner, and
visible to the user. The code around it already says that it handles
errors by returning 0 for the size, and I've extended that to one more
case.
In practice, I have seen this come up in failures of the following test:
failure.test_failpoints.TestFailpoints.test_failpoints[table_format: hbase/none | exec_option: {'batch_size': 0, 'num_nodes': 0, 'disable_codegen_rows_threshold': 0, 'disable_codegen': False, 'abort_on_error': 1, 'debug_action': None, 'exec_single_node_rows_threshold': 0} | mt_dop: 4 | location: OPEN | action: MEM_LIMIT_EXCEEDED | query: select * from alltypessmall union all select * from alltypessmall]
I saw this failure only happen in some test-with-docker runs,
inconsistently. The error is a little bit hard to spot, but by
correlating the timestamp of the failing test (which just complains
about NullPointerException), you can find a Java stack trace complaining
of a NPE in "regionLoad.getStorefileSizeMB()". I think the likely cause
is regionLoad being null.
Change-Id: I02f06daf69e7f7e97c9ecc13997147530c2f9d3f
Reviewed-on: http://gerrit.cloudera.org:8080/10531
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/fc0c5f58
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/fc0c5f58
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/fc0c5f58
Branch: refs/heads/master
Commit: fc0c5f58f00b360a7651187e0b0fe79add426742
Parents: fdd9d05
Author: Philip Zeyliger <ph...@cloudera.com>
Authored: Tue May 29 12:30:08 2018 -0700
Committer: Impala Public Jenkins <im...@cloudera.com>
Committed: Thu May 31 07:02:21 2018 +0000
----------------------------------------------------------------------
fe/src/main/java/org/apache/impala/catalog/HBaseTable.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/impala/blob/fc0c5f58/fe/src/main/java/org/apache/impala/catalog/HBaseTable.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/catalog/HBaseTable.java b/fe/src/main/java/org/apache/impala/catalog/HBaseTable.java
index cf36a89..ceb6e70 100644
--- a/fe/src/main/java/org/apache/impala/catalog/HBaseTable.java
+++ b/fe/src/main/java/org/apache/impala/catalog/HBaseTable.java
@@ -642,12 +642,16 @@ public class HBaseTable extends Table {
// If the serverLoad is null, the master doesn't have information for this region's
// server. This shouldn't normally happen.
if (serverLoad == null) {
- LOG.error("Unable to find load for server: " + location.getServerName() +
+ LOG.error("Unable to find server load for server: " + location.getServerName() +
" for location " + info.getRegionNameAsString());
return 0;
}
RegionLoad regionLoad = serverLoad.getRegionsLoad().get(info.getRegionName());
-
+ if (regionLoad == null) {
+ LOG.error("Unable to find regions load for server: " + location.getServerName() +
+ " for location " + info.getRegionNameAsString());
+ return 0;
+ }
final long megaByte = 1024L * 1024L;
return regionLoad.getStorefileSizeMB() * megaByte;
}