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

Chinmay Kulkarni commented on PHOENIX-4579:
-------------------------------------------

[~tdsilva] and [~jamestaylor] please take a look at my PR: 
[https://github.com/apache/phoenix/pull/295|https://github.com/apache/phoenix/pull/295]
 and we can discuss if the approach seems correct. 

*Work done in this PR:*
# Modify the _GetVersionResponse_ protobuf declaration to return an optional 
long field corresponding to the system catalog timestamp.
# We use the timestamp returned from the _getVersion()_ call inside 
_checkClientServerCompatibility()_ to decide whether or not the system catalog 
table needs to be updated or not. Of course, if this is the first connection to 
the server then there is no entry for system catalog inside system catalog, so 
this timestamp does not exist yet and is thus ignored.
# Check for the presence of SYSTEM:CATALOG or SYSTEM.CATALOG and check 
client-server compatibility in both cases instead of just in the case when 
namespace mapping is enabled.
# If the physical system catalog table exists, we no longer try to create it 
and thus the code that updates the hbase metadata will no longer run. *Is this 
a problem?*
# In case we detect that system catalog needs to be upgraded, if 
{{phoenix.autoupgrade.enabled}} is true, we upgrade system tables, otherwise we 
just log an error asking the user to manually run "EXECUTE UPGRADE". Before 
this, we have set {{upgradeRequired}} to true, so the user will be blocked from 
executing any statements except for "EXECUTE UPGRADE".

*Testing plan:*
* When namespaceMapping is enabled, check that SYSTEM:CATALOG is created when 
connecting for the first time.
* When namespaceMapping is disabled, check that SYSTEM.CATALOG is created when 
connecting for the first time.
* Check that subsequent connections between jar compatible client-server do not 
try to create system catalog again.
* Connect lower version client to newer version server -> Should connect as is, 
without trying to upgrade system catalog.
* Connect a new client to a newly upgraded cluster which has not been connected 
to yet i.e. system catalog on this cluster is still old. In this case, system 
catalog should get upgraded only if {{phoenix.autoupgrade.enabled}} is true.
* Ensure that "EXECUTE UPGRADE" command works after these changes.

Please let me know if you guys have any suggesstions. Thanks.

> Add a config to conditionally create Phoenix meta tables on first client 
> connection
> -----------------------------------------------------------------------------------
>
>                 Key: PHOENIX-4579
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4579
>             Project: Phoenix
>          Issue Type: New Feature
>            Reporter: Mujtaba Chohan
>            Assignee: Chinmay Kulkarni
>            Priority: Major
>         Attachments: PHOENIX-4579.patch
>
>
> Currently we create/modify Phoenix meta tables on first client connection. 
> Adding a property to make it configurable (with default true as it is 
> currently implemented).
> With this property set to false, it will avoid lockstep upgrade requirement 
> for all clients when changing meta properties using PHOENIX-4575 as this 
> property can be flipped back on once all the clients are upgraded.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to