virajjasani commented on a change in pull request #1257:
URL: https://github.com/apache/phoenix/pull/1257#discussion_r661283739



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/MetaDataUtil.java
##########
@@ -100,6 +101,11 @@
 
     public static final byte[] DATA_TABLE_NAME_PROP_BYTES = 
Bytes.toBytes(DATA_TABLE_NAME_PROP_NAME);
 
+    private static final Map<MajorMinorVersion, MajorMinorVersion> 
ALLOWED_SERVER_CLIENT_MAJOR_VERSION =
+            ImmutableMap.of(
+                    new MajorMinorVersion(5, 1), new MajorMinorVersion(4, 16)

Review comment:
       Basically we have these validations:
   1. Client major and minor cannot be ahead of server
   2. Client major version must at least be up to server major version
   
   What we are doing here is relaxing validation no 2. If we already know of 
client with old major version (4.x) being compatible to server with new major 
version (5.x), then we can relax major compatibility restriction (rule no 2) by 
adding such specific major/minor versions in this map.
   In future, if we release 4.17 and we are aware that 4.17 client is backward 
compatible with 5.1 and 5.2 servers, we can add new entires in this map:
   ```
   new MajorMinorVersion(5, 1), new MajorMinorVersion(4, 17)  => 4.17 client 
can connect to 5.1 server
   new MajorMinorVersion(5, 2), new MajorMinorVersion(4, 17)  => 4.17 client 
can connect to 5.2 server
   new MajorMinorVersion(5, 2), new MajorMinorVersion(4, 16)  => 4.16 client 
can connect to 5.2 server
   ```
   
   Without updating above entires, 4.17 client would not be able to connect to 
any 5.x server because rule no 2 (mentioned above) will fail this with:
   ```
   java.sql.SQLException: ERROR 2006 (INT08): Incompatible jars detected 
between client and server. Major version of client is less than that of the 
server. Client version: 4.17.0; Server version: 5.1.0
   ```
   
   > This 4.16 client might run against a 4.14 server before upgrade, or a 4.15 
server before upgrade?
   
   This might never need to be supported unless I am missing something. So 
let's say we are running 4.14 client and server, now we upgrade server to 4.15 
and client remains at 4.14, we are good. Instead of upgrading client, we again 
decide to upgrade server to 4.16, and we are still good because 4.14 client can 
connect to 4.16 server.
   Before we upgrade server to 5.1, we will want to bring client to 4.16 so 
that 4.16 client can connect to 5.1 server.
   However, in this entire case, we never need 4.16 client to run against 
4.14/4.15 server. Correct?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to