ChinmaySKulkarni commented on a change in pull request #676: PHOENIX-5636: 
Improve the error message when client connects to server with higher major 
version
URL: https://github.com/apache/phoenix/pull/676#discussion_r383457664
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 ##########
 @@ -1553,11 +1543,20 @@ public GetVersionResponse call(MetaDataService 
instance)
                 long serverJarVersion = versionResponse.getVersion();
                 isTableNamespaceMappingEnabled |= 
MetaDataUtil.decodeTableNamespaceMappingEnabled(serverJarVersion);
 
-                if (!isCompatible(serverJarVersion)) {
-                    isIncompatible = true;
-                    HRegionLocation name = regionMap.get(result.getKey());
-                    buf.append(name);
-                    buf.append(';');
+                MetaDataUtil.ClientServerCompatibility compatibility = 
MetaDataUtil.areClientAndServerCompatible(serverJarVersion);
+                if (!compatibility.getIsCompatible()) {
+                    if (compatibility.getErrorCode() == 
SQLExceptionCode.OUTDATED_JARS.getErrorCode()) {
+                        HRegionLocation name = regionMap.get(result.getKey());
+                        errorMessage.append("Newer Phoenix clients can't 
communicate with older "
+                                + "Phoenix servers. " + 
getClientandServerVersions(serverJarVersion)
+                                + " The following servers require an updated "
+                                + QueryConstants.DEFAULT_COPROCESS_JAR_NAME
+                                + " to be put in the classpath of HBase: ");
+                        errorMessage.append(name);
+                        errorMessage.append(';');
+                    } else {
 
 Review comment:
   Make this more specific with an `else if` rather than an `else`? Otherwise 
this breaks if tomorrow we have other cases for incompatibility.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to