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

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

[~jamestaylor], [~tdsilva] 

So overall, the workflow can be as follows:
 * Inside _ConnectionQueryServicesImpl.init(),_ based on whether namespace 
mapping is enabled or not, we can check the presence of SYSTEM:CATALOG or 
SYSTEM.CATALOG.
 * We can have a configuration {{phoenix.system.table.create.attempt.enabled}} 
as mentioned by [~tdsilva] above.
 * *If sycat does not exist* and if 
{{phoenix.system.table.create.attempt.enabled}} is true, shouldn't we attempt 
to create it instead of throwing an exception? In case this config is false, we 
should throw an exception.
 * *Now that syscat exists for sure*, we then use 
_ConnectionQueryServicesImpl.checkClientServerCompatibility()_, wherein we add 
the new information corresponding to the version of syscat as part of the 
response from the g_etVersion()_ RPC. In case of a new client and new server:
 ** If {{phoenix.autoupgrade.enabled}} is false and the syscat version we get 
back is older than the current client version, we can throw an error mentioning 
that the user must execute "EXECUTE UPGRADE" manually before connecting.
 ** If {{phoenix.autoupgrade.enabled}} is true, we perform the syscat upgrade.

As for the sytem table metadata always updating, we call 
_ConnectionQueryServicesImpl.ensureTableCreated()_ with the argument 
"modifyExistingMetaData" hard-coded to true when called inside 
_ConnectionQueryServicesImpl.createTable()._ To avoid properties from being 
reset, we can check that the tableType == PTableType.SYSTEM and disable 
metadata from being modified.

> 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