This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch 4.x-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
     new f6f0088  PHOENIX-5588 Client-Server Incompatibility False Alarm
f6f0088 is described below

commit f6f0088744824fc98866c9c4e88979fbee7e5155
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 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 {

Reply via email to