You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2020/01/31 02:33:01 UTC

[GitHub] [phoenix] sguggilam commented on a change in pull request #676: PHOENIX-5636: Improve the error message when client connects to server with higher major version

sguggilam 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_r373292039
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 ##########
 @@ -1571,15 +1576,28 @@ public GetVersionResponse call(MetaDataService instance)
                 }
             }
         }
-        if (isIncompatible) {
-            buf.setLength(buf.length()-1);
-            throw new SQLExceptionInfo.Builder(SQLExceptionCode.OUTDATED_JARS).setMessage(buf.toString()).build().buildException();
+        if (!(errorCode.toString().equals(new StringBuilder().toString()))) {
+            if (Integer.parseInt(errorCode.toString()) == SQLExceptionCode.OUTDATED_JARS.getErrorCode()) {
+                errorMessage.setLength(errorMessage.length()-1);
+                throw new SQLExceptionInfo.Builder(SQLExceptionCode.OUTDATED_JARS).setMessage(errorMessage.toString()).build().buildException();
+            } else {
+                throw new SQLExceptionInfo.Builder(SQLExceptionCode.INCOMPATIBLE_CLIENT_SERVER_JAR).setMessage(errorMessage.toString()).build().buildException();
+            }
         }
+
         if (systemCatalogTimestamp < MIN_SYSTEM_TABLE_TIMESTAMP) {
             throw new UpgradeRequiredException(systemCatalogTimestamp);
         }
     }
 
+    private String displayClientandServerVersions(long serverJarVersion) {
+        String clientVersion = PHOENIX_MAJOR_VERSION + "." + PHOENIX_MINOR_VERSION + "." + PHOENIX_PATCH_NUMBER;
 
 Review comment:
   This is already present , you can probably just use it : https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java#L151

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services