This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push: new 87ff68a PHOENIX-5588 Client-Server Incompatibility False Alarm 87ff68a is described below commit 87ff68ad7c30a0f6b3696b1fd53e0b14925c724a Author: Istvan Toth <st...@stoty.hu> AuthorDate: Wed Nov 27 16:06:46 2019 +0100 PHOENIX-5588 Client-Server Incompatibility False Alarm use standard exception parsing for coprocessor check Signed-off-by: Geoffrey Jacoby gjac...@apache.org Closes #644 --- .../phoenix/query/ConnectionQueryServicesImpl.java | 49 ++++++++++++---------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java index 2117b16..ad9d2fc 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java @@ -1478,22 +1478,32 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement ht = this.getTable(metaTable); final byte[] tablekey = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME_BYTES; - final Map<byte[], GetVersionResponse> results = - ht.coprocessorService(MetaDataService.class, tablekey, tablekey, new Batch.Call<MetaDataService,GetVersionResponse>() { - @Override - public GetVersionResponse call(MetaDataService instance) throws IOException { - ServerRpcController controller = new ServerRpcController(); - BlockingRpcCallback<GetVersionResponse> rpcCallback = - new BlockingRpcCallback<>(); - GetVersionRequest.Builder builder = GetVersionRequest.newBuilder(); - builder.setClientVersion(VersionUtil.encodeVersion(PHOENIX_MAJOR_VERSION, PHOENIX_MINOR_VERSION, PHOENIX_PATCH_NUMBER)); - instance.getVersion(controller, builder.build(), rpcCallback); - if(controller.getFailedOn() != null) { - throw controller.getFailedOn(); - } - return rpcCallback.get(); - } - }); + Map<byte[], GetVersionResponse> results; + try { + results = + ht.coprocessorService(MetaDataService.class, tablekey, tablekey, + new Batch.Call<MetaDataService, GetVersionResponse>() { + @Override + public GetVersionResponse call(MetaDataService instance) + throws IOException { + ServerRpcController controller = new ServerRpcController(); + BlockingRpcCallback<GetVersionResponse> rpcCallback = + new BlockingRpcCallback<>(); + GetVersionRequest.Builder builder = + GetVersionRequest.newBuilder(); + builder.setClientVersion( + VersionUtil.encodeVersion(PHOENIX_MAJOR_VERSION, + PHOENIX_MINOR_VERSION, PHOENIX_PATCH_NUMBER)); + instance.getVersion(controller, builder.build(), rpcCallback); + if (controller.getFailedOn() != null) { + throw controller.getFailedOn(); + } + return rpcCallback.get(); + } + }); + } catch (Throwable t) { + throw ServerUtil.parseServerException(t); + } for (Map.Entry<byte[],GetVersionResponse> result : results.entrySet()) { // This is the "phoenix.jar" is in-place, but server is out-of-sync with client case. GetVersionResponse versionResponse = result.getValue(); @@ -1526,13 +1536,6 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement + " is consistent on client and server.") .build().buildException(); } lowestClusterHBaseVersion = minHBaseVersion; - } catch (SQLException | AccessDeniedException e) { - throw e; - } catch (Throwable t) { - // This is the case if the "phoenix.jar" is not on the classpath of HBase on the region server - throw new SQLExceptionInfo.Builder(SQLExceptionCode.INCOMPATIBLE_CLIENT_SERVER_JAR).setRootCause(t) - .setMessage("Ensure that " + QueryConstants.DEFAULT_COPROCESS_JAR_NAME + " is put on the classpath of HBase in every region server: " + t.getMessage()) - .build().buildException(); } finally { if (ht != null) { try {