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

Thomas D'Silva commented on PHOENIX-1676:
-----------------------------------------

[~jesse_yates]

I debugged using your test 
(https://github.com/jyates/phoenix/tree/fix-index-qos) and with the following 
scheduler factory and rpc controller factory settings : 
{code}
conf.set(HRegionServer.REGION_SERVER_RPC_SCHEDULER_FACTORY_CLASS,PhoenixIndexRpcSchedulerFactory.class.getName());
conf.set(RpcControllerFactory.CUSTOM_CONTROLLER_CONF_KEY,IndexQosRpcControllerFactory.class.getName();
{code}
I hardcoded IndexQosRpcController.isIndexTable() to return true for the test 
index table name, just for debugging. 

IndexQosRpcController.setPriority gets called and sets the priority of the 
index table correctly however I could not find an associated call to 
PhoenixIndexRpcScheduler.dispatch. However PhoenixIndexRpcScheduler.dispatch 
was being called for regular hbase tables. 

The call stack for a hbase system tables is 
{code}
RpcClient.call(MethodDescriptor, Message, CellScanner, Message, User, 
InetSocketAddress, int, int) line: 1455   
RpcClient.callBlockingMethod(Descriptors$MethodDescriptor, RpcController, 
Message, Message, User, InetSocketAddress, int) line: 1661    
RpcClient$BlockingRpcChannelImplementation.callBlockingMethod(Descriptors$MethodDescriptor,
 RpcController, Message, Message) line: 1719 
ClientProtos$ClientService$BlockingStub.scan(RpcController, 
ClientProtos$ScanRequest) line: 30387
{code}

and for index tables is 
{code}
ClientProtos$ClientService$2.callBlockingMethod(Descriptors$MethodDescriptor, 
RpcController, Message) line: 29949       
RpcServer.call(BlockingService, MethodDescriptor, Message, CellScanner, long, 
MonitoredRPCHandler) line: 2029   
CoprocessorHConnection$1.callBlockingMethod(Descriptors$MethodDescriptor, 
RpcController, Message, Message) line: 138    
ClientProtos$ClientService$BlockingStub.multi(RpcController, 
ClientProtos$MultiRequest) line: 30435     
{code}

It looks like for hbase tables its calling callBlockingMethod in RpcClient and 
for the index table it calls CoprocessorHConnection. 
Could this be why PhoenixIndexRpcScheduler.dispatch is not being called for the 
index updates?


> Set priority of Index Updates correctly 
> ----------------------------------------
>
>                 Key: PHOENIX-1676
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1676
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Thomas D'Silva
>            Assignee: Thomas D'Silva
>
> I spoke to Jesse offline about this. 
> The priority of index updates isn't being set correctly because of the use of 
> CoprocessorHConnection (which all coprocessors use if they create an HTable 
> via the CPEnvironment).
> Specifically the flow happens like this: the CoprocessorHTableFactory 
> attempts to set the connection qos factory, but it is ignored because the 
> CoprocessorHConnection is used (instead of a standard HConnection) and the 
> #getClient method just goes straight into the rpc scheduler of the 
> HRegionServer, if its on the same server. This allows the region to be 
> directly accessed, but without actually going over the loopback or 
> serializing any information.
> However, this means it ignores the configured rpccontroller factory and the 
> override setting of the rpc priority. We probably shouldn't be runtime 
> changing the configuration - instead we should probably be using some other 
> serialized information.
> The primary fix would seems to be that the regionserver needs to be 
> configured with the IndexQosRpcControllerFactory and then use a static map 
> (or cache of the index metadata) to set the qos for the index servers. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to