[ https://issues.apache.org/jira/browse/HBASE-18359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16256726#comment-16256726 ]
Anoop Sam John commented on HBASE-18359: ---------------------------------------- This issue (As stated in subject) is no longer valid for latest HBase. On older versions also it is not as the CoprocessorHConnection#getConnectionForEnvironment was taking a CoprocessorEnvironment instance not config. So to change the configs, u will end up changing the actual region level config. Ya to solve the issue (said in this jira) having a workaround of CoprocessorHConnectionTableFactory. Ya what that doing is correct. From 2.0 u can not have this CoprocessorHConnectionTableFactory. What we need in HBase is an API CoprocessorEnvironment#getConnection(Config). This call will always make new connection (which is short circuit enabled). So caching of this and reuse the callee has to take care. Is that ok? Then we can provide a quick patch and make it avail in beta-1 release. I will close down this jira and open a new one with correct title and desc. > CoprocessorHConnection#getConnectionForEnvironment should read config from > CoprocessorEnvironment > ------------------------------------------------------------------------------------------------- > > Key: HBASE-18359 > URL: https://issues.apache.org/jira/browse/HBASE-18359 > Project: HBase > Issue Type: Bug > Reporter: Samarth Jain > Fix For: 2.0.0 > > > It seems like the method getConnectionForEnvironment isn't doing the right > thing when it is creating a CoprocessorHConnection by reading the config from > HRegionServer and not from the env passed in. > If coprocessors want to use a CoprocessorHConnection with some custom config > settings, then they have no option but to configure it in the hbase-site.xml > of the region servers. This isn't ideal as a lot of times these "global" > level configs can have side effects. See PHOENIX-3974 as an example where > configuring ServerRpcControllerFactory (a Phoenix implementation of > RpcControllerFactory) could result in deadlocks. Or PHOENIX-3983 where > presence of this global config causes our index rebuild code to incorrectly > use handlers it shouldn't. > If the CoprocessorHConnection created through getConnectionForEnvironment API > used the CoprocessorEnvironment config, then it would allow co-processors to > pass in their own config without needing to configure them in hbase-site.xml. > The change would be simple. Basically change the below > {code} > if (services instanceof HRegionServer) { > return new CoprocessorHConnection((HRegionServer) services); > } > {code} > to > {code} > if (services instanceof HRegionServer) { > return new CoprocessorHConnection(env.getConfiguration(), > (HRegionServer) services); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)