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

Lars Hofhansl commented on PHOENIX-5134:
----------------------------------------

Agree with [~jamestaylor].

-1 on the change as proposed. Especially in the Salesforce case with 1000's of 
Orgs (tenants) this would be disastrous.

Perhaps we can remember and key on specific parameters passed via the URL, even 
that could be dangerous.

Or perhaps better we can add an explicit tag(s) to distinguish connections; for 
example a client could add a "small-timeout", etc. That way we can cover all 
use cases. If you need different parameters per tenant, you add the tenant id 
to the tag(s).

 

> Phoenix Connection Driver #normalize does not distinguish different url with 
> same ZK quorum but different Properties
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-5134
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5134
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Xu Cang
>            Assignee: Xinyi Yan
>            Priority: Minor
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> In this code
> https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L228
> Phoenix now uses a cache to maintain Hconnections. The cache's key is 
> generated by 'normalize' method here:
> https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriver.java#L312
> The normalize method takes ZK quorum, port, rootNode, principle and keytab 
> into account. But not properties passed in in url. 
> E.g.
> Request to reate one connection by this url: 
> jdbc:phoenix:localhost:61733;TenantId=1
> Request to create another connection by this url
> jdbc:phoenix:localhost:61733;TenantId=2
> Based on logic we have, it will result in one same Hconnection in the 
> connection cache here. 
> This might not be something we really want. 
> For example, different tenant wants to have different HBase config (such as 
> HBase timeout settings) With the same Hconnection returned, tenant2's config 
> will be ignored silently. 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to