[ 
https://issues.apache.org/jira/browse/HBASE-17387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ted Yu updated HBASE-17387:
---------------------------
    Description: 
For RSRpcServices#doNonAtomicRegionMutation() :
{code}
    for (ClientProtos.Action action: actions.getActionList()) {
...
      } catch (IOException ie) {
        rpcServer.getMetrics().exception(ie);
        resultOrExceptionBuilder = ResultOrException.newBuilder().
          setException(ResponseConverter.buildException(ie));
      }
      if (resultOrExceptionBuilder != null) {
        // Propagate index.
        resultOrExceptionBuilder.setIndex(action.getIndex());
        builder.addResultOrException(resultOrExceptionBuilder.build());
      }
{code}
The exceptions are added to builder in the for loop.
The ClientProtos.ResultOrException.Builder instance is created within the for 
loop.

For large multi call, this may incur non-trivial overhead for garbage collector 
if there're many exceptions.
e.g. Here was sample debug log showing the actions in a batch:
{code}
2016-12-23 04:21:56,263 DEBUG 
org.apache.hadoop.hbase.regionserver.RSRpcServices: NonAtomicRegionMutation 
batch summary: numAppends=0, numDeletes=11, numGets=0, numIncrements=15638, 
numPuts=15627, numServiceCalls=0, serializedSize=3871713, user=hbase/pob3.G.COM 
(auth:KERBEROS), client=null
{code}
Note the large number of increments in the batch.
When the increments encounter conflict at server side, the overhead of 
stringified exceptions in response is considerable.

  was:
For RSRpcServices#doNonAtomicRegionMutation() :
{code}
    for (ClientProtos.Action action: actions.getActionList()) {
...
      } catch (IOException ie) {
        rpcServer.getMetrics().exception(ie);
        resultOrExceptionBuilder = ResultOrException.newBuilder().
          setException(ResponseConverter.buildException(ie));
      }
      if (resultOrExceptionBuilder != null) {
        // Propagate index.
        resultOrExceptionBuilder.setIndex(action.getIndex());
        builder.addResultOrException(resultOrExceptionBuilder.build());
      }
{code}
The exceptions are added to builder in the for loop.
The ClientProtos.ResultOrException.Builder instance is created within the for 
loop.

For large multi call, this may incur non-trivial overhead for garbage collector 
if there're many exceptions.


> Reduce the overhead of exception report in RegionActionResult for multi()
> -------------------------------------------------------------------------
>
>                 Key: HBASE-17387
>                 URL: https://issues.apache.org/jira/browse/HBASE-17387
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>            Priority: Minor
>         Attachments: 17387.v1.txt, 17387.v2.txt
>
>
> For RSRpcServices#doNonAtomicRegionMutation() :
> {code}
>     for (ClientProtos.Action action: actions.getActionList()) {
> ...
>       } catch (IOException ie) {
>         rpcServer.getMetrics().exception(ie);
>         resultOrExceptionBuilder = ResultOrException.newBuilder().
>           setException(ResponseConverter.buildException(ie));
>       }
>       if (resultOrExceptionBuilder != null) {
>         // Propagate index.
>         resultOrExceptionBuilder.setIndex(action.getIndex());
>         builder.addResultOrException(resultOrExceptionBuilder.build());
>       }
> {code}
> The exceptions are added to builder in the for loop.
> The ClientProtos.ResultOrException.Builder instance is created within the for 
> loop.
> For large multi call, this may incur non-trivial overhead for garbage 
> collector if there're many exceptions.
> e.g. Here was sample debug log showing the actions in a batch:
> {code}
> 2016-12-23 04:21:56,263 DEBUG 
> org.apache.hadoop.hbase.regionserver.RSRpcServices: NonAtomicRegionMutation 
> batch summary: numAppends=0, numDeletes=11, numGets=0, numIncrements=15638, 
> numPuts=15627, numServiceCalls=0, serializedSize=3871713, 
> user=hbase/pob3.G.COM (auth:KERBEROS), client=null
> {code}
> Note the large number of increments in the batch.
> When the increments encounter conflict at server side, the overhead of 
> stringified exceptions in response is considerable.



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

Reply via email to