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

Chinmay Kulkarni commented on PHOENIX-5920:
-------------------------------------------

+1 to removing that. I don't see that region location map logic used anywhere, 
nice catch [~gjacoby]. The only place where we use it is 
[here|https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L1549],
 but that is just to get the region name of the region hosting the 
SYSTEM.CATALOG metadata rows within SYSTEM.CATALOG itself. Even given 
splittable SYSTEM.CATALOG (based on the split policy), I don't think this 
metadata can span multiple regions, so not sure [this for 
loop|https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L1540]
 makes sense (we should only be getting 1 response, right?) and thus logging 
the region name is also not really useful.

Based on the way this method is written and logging is done, it seems that we 
expected checkClientServerCompatibility to check the Phoenix jar version of 
*each* RS and make sure it is >= the client jar version, however that's really 
not what we're doing here (we just check the RS hosting SYSCAT).



> Skip SYSTEM TABLE checks while creating phoenix connection if client has set 
> the config
> ---------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-5920
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5920
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Neha Gupta
>            Assignee: Neha Gupta
>            Priority: Major
>
> Phoenix checks upgrade path even if client has set "DoNotUpgrade" config. 
> When HMaster failover happens and Phoenix client creating phoenix connection, 
> we get exception "org.apache.hadoop.hbase.PleaseHoldException: Master is 
> initializing" because phoenix calls HBase admin apis to check if SYSTEM 
> tables are in place and does not require an upgrade.  
> [CQSI.init()|https://github.com/apache/phoenix/blob/aad583670ea821286ab5e2460ce0ab7255d474c4/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L3169]
>  initiates creating systems table and 
> [CQSI.ensureTableCreated|https://github.com/apache/phoenix/blob/aad583670ea821286ab5e2460ce0ab7255d474c4/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L1246]
>  is checking if SYTEM table requires upgrade and calls hbaseAdminApis to 
> perform this operation which fails if HMaster is not running. Can we honor 
> the "DoNotUpgrade" config by client(By making an assumption that SYSTEM table 
> is already up-to-date and phoenix client shouldn't perform any upgrades) and 
> skip this upgrade checks ?
> EnsureTableCreated performs bunch of client-server compatibility checks like:
> 1.SYSTEM.CATALOG exists and its timestamp < MIN_SYSTEM_TABLE_TIMESTAMP
> 2.SYSTEM.CATALOG exists, but client and server-side namespace mapping is 
> enabled so we need to migrate SYSTEM tables to the SYSTEM namespace
> 3.When an end-user uses the vanilla PhoenixDriver to create a connection and 
> a requirement for upgrade is detected. In this case, the user should get a 
> connection on which they are only able to run "EXECUTE UPGRADE".



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to