[
https://issues.apache.org/jira/browse/HBASE-19301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16268223#comment-16268223
]
Anoop Sam John commented on HBASE-19301:
----------------------------------------
Ys. We can not really say here the user.
On short circuited connection (Using getConnection API), the user in the
Connection will be hbase super user always. This is the case when the
targetted server is this same or any other. But the effective user as seen by
the code paths may be different. When it is call to other server its is fine
that the hbase super user will be the user. Because in RPC, the Connection user
is getting passed. But when the target server is this, there is no RPC context
and we are not even doing any reset of the old context and so the path uses the
old context. So the user is showing as the initial RPC op user.
Than just for user this brings some other possible issue also. Say within a CP
hook, we got the short circuit connection (Any of the API) and then using that
issuing a read request. (Say the original req was also a read req) Now as said
above, the old RPC conext is still getting used as there is no RPC involved in
short circuited connection. We are doing accounting of the response cells size
/ block size etc and this math accumulation happens over RpcConext instance.
Means the short circuited get call's return size also added to the old size
accounting which can give wrong prediction on the actual initial RPC req.
Said that, there should be some way to reset this RPC conext when the short
circuited call happens. And we get the RPC context and so the user info via
ThreadLocal. Adding more issue because some times the execution path gives job
to another thread from a pool.
This looks to be larger problem now?
> Provide way for CPs to create short circuited connection with custom
> configurations
> -----------------------------------------------------------------------------------
>
> Key: HBASE-19301
> URL: https://issues.apache.org/jira/browse/HBASE-19301
> Project: HBase
> Issue Type: Sub-task
> Components: Coprocessors
> Reporter: Anoop Sam John
> Assignee: Anoop Sam John
> Fix For: 2.0.0-beta-1
>
> Attachments: HBASE-19301-addendum.patch, HBASE-19301.patch,
> HBASE-19301_V2.patch, HBASE-19301_V2.patch
>
>
> Over in HBASE-18359 we have discussions for this.
> Right now HBase provide getConnection() in RegionCPEnv, MasterCPEnv etc. But
> this returns a pre created connection (per server). This uses the configs at
> hbase-site.xml at that server.
> Phoenix needs creating connection in CP with some custom configs. Having this
> custom changes in hbase-site.xml is harmful as that will affect all
> connections been created at that server.
> This issue is for providing an overloaded getConnection(Configuration) API
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)