Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-6500 Allow 4.16 client to connect to 5.1 server - #1257
Conversation
stoty
commented
Jun 28, 2021
💔 -1 overall
This message was automatically generated. |
| private static final Map<MajorMinorVersion, MajorMinorVersion> ALLOWED_SERVER_CLIENT_MAJOR_VERSION = | ||
| ImmutableMap.of( | ||
| new MajorMinorVersion(5, 1), new MajorMinorVersion(4, 16) |
There was a problem hiding this comment.
Per https://phoenix.apache.org/upgrading.html
An older client (two minor versions back) will work with a newer server jar when the minor version is different, but not visa versa.
In other words, clients do not need to be upgraded in lock step with the server.
Does this mean you also need
new MajorMinorVersion(4, 15)
new MajorMinorVersion(4, 14)
? This 4.16 client might run against a 4.14 server before upgrade, or a 4.15 server before upgrade? If supporting clients two minor versions back.
There was a problem hiding this comment.
Basically we have these validations:
- Client major and minor cannot be ahead of server
- 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?
Signed-off-by: Andrew Purtell <apurtell@apache.org>
Signed-off-by: Andrew Purtell <apurtell@apache.org>
Signed-off-by: Andrew Purtell <apurtell@apache.org>
No description provided.