[ 
https://issues.apache.org/jira/browse/PHOENIX-6499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17653937#comment-17653937
 ] 

Gourab Taparia commented on PHOENIX-6499:
-----------------------------------------

I was trying to see if there is way a straightforward way to check if the 
schema hasn't changed across versions for SYS tables - but probably there 
isn't. From the code path looks like whenever there is a upgrade in the server 
version, the upgrade 
path([https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L3506])
 detects it, and ensures that the SYS tables are updated(via 
[upgradeSystemCatalogIfRequired|https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L3776]
 and 
[upgradeOtherSystemTablesIfRequired|https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L4276])
 to the latest version. 

For e.g. a case where a client 4.1 is connecting to 5.2 server, and assume 
there have been no changes in SYS table schemas in these 2 versions. Then is 
there a way to compare the schemas of the SYS tables across the version 
programmatically ? A theoritical approach is to use the versioning done in 
HBase, to compare across the table schemas for the given client version and the 
current server version - and if this is same - we allow the client to connect. 
This should be done for all the SYS tables. However, I am not aware of the 
nuanaces of the versioning comparision for schemas, and not sure if that will 
pan out. 

[~vjasani] [~tkhurana] Reaching out early to discuss approaches on how we can 
handle this.

> Allow old client to connect to new server with higher major version than 
> client
> -------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6499
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6499
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Viraj Jasani
>            Assignee: Gourab Taparia
>            Priority: Major
>
> Although we do not allow old client with lower major version to connect to 
> new server with higher major version, we should have this check based on 
> System table schema. If there is no change in System tables schema b/ major 
> versions of old client and new server (e.g 4.16 client and 5.1 server), we 
> should let old client connect to new server.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to