Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-17387

Reduce the overhead of exception report in RegionActionResult for multi()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.4.0, 1.3.1, 2.0.0
    • None
    • None
    • Reviewed

    Description

      For RSRpcServices#doNonAtomicRegionMutation() :

          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());
            }
      

      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:

      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
      

      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.

      Attachments

        1. 17387.v3.txt
          3 kB
          Ted Yu
        2. 17387.v2.txt
          13 kB
          Ted Yu
        3. 17387.v1.txt
          3 kB
          Ted Yu

        Issue Links

          Activity

            People

              yuzhihong@gmail.com Ted Yu
              yuzhihong@gmail.com Ted Yu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: