You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by st...@apache.org on 2019/12/09 14:59:53 UTC
[phoenix] branch 4.x-HBase-1.5 updated: PHOENIX-5588 Client-Server
Incompatibility False Alarm
This is an automated email from the ASF dual-hosted git repository.
stoty pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
new 7a4c7ab PHOENIX-5588 Client-Server Incompatibility False Alarm
7a4c7ab is described below
commit 7a4c7ab3cb20090bf868fa96e7aa54c923bd5bdb
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 gjacoby@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 a66d2eb..6a4ae41 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
@@ -1471,22 +1471,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();
@@ -1519,13 +1529,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 {