You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2017/08/01 15:03:20 UTC

[4/4] incubator-impala git commit: IMPALA-1470: Fix error message with catalog down

IMPALA-1470: Fix error message with catalog down

When the catalog server cannot be reached, currently impala client would report
a NullpointerException to shell with no context. The improved error message
with this patch is:
> ERROR: InternalException: Error requesting prioritized load:
Couldn't open transport for localhost:26000 (connect() failed: Connection refused)
> Error making an RPC call to Catalog server.

The bug is when the client gets an RPC error, it tries to box the error into a
field of a Thrift struct but does not set the optional field to be present.
This patch makes the status field in TPrioritizeLoadResponse required.

Change-Id: Ic695faf89b146bdaa145aaca87f85579137b67c5
Reviewed-on: http://gerrit.cloudera.org:8080/7539
Reviewed-by: Tim Armstrong <ta...@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/ae720087
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/ae720087
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/ae720087

Branch: refs/heads/master
Commit: ae72008747d453f4378fddb8a245b570b0528e30
Parents: 3059024
Author: Tianyi Wang <tw...@cloudera.com>
Authored: Mon Jul 31 11:59:54 2017 -0700
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Tue Aug 1 07:35:28 2017 +0000

----------------------------------------------------------------------
 be/src/service/fe-support.cc        | 4 +---
 common/thrift/CatalogService.thrift | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ae720087/be/src/service/fe-support.cc
----------------------------------------------------------------------
diff --git a/be/src/service/fe-support.cc b/be/src/service/fe-support.cc
index 0bc6285..379829d 100644
--- a/be/src/service/fe-support.cc
+++ b/be/src/service/fe-support.cc
@@ -427,9 +427,7 @@ Java_org_apache_impala_service_FeSupport_NativePrioritizeLoad(
   Status status = catalog_op_executor.PrioritizeLoad(request, &result);
   if (!status.ok()) {
     LOG(ERROR) << status.GetDetail();
-    // Create a new Status, copy in this error, then update the result.
-    Status catalog_service_status(result.status);
-    catalog_service_status.MergeStatus(status);
+    status.AddDetail("Error making an RPC call to Catalog server.");
     status.ToThrift(&result.status);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ae720087/common/thrift/CatalogService.thrift
----------------------------------------------------------------------
diff --git a/common/thrift/CatalogService.thrift b/common/thrift/CatalogService.thrift
index 7ba431b..ef19d25 100644
--- a/common/thrift/CatalogService.thrift
+++ b/common/thrift/CatalogService.thrift
@@ -248,7 +248,7 @@ struct TPrioritizeLoadRequest {
 
 struct TPrioritizeLoadResponse {
   // The status of the operation, OK if the operation was successful.
-  1: optional Status.TStatus status
+  1: required Status.TStatus status
 }
 
 // Request to perform a privilege check with the Sentry Service to determine