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

Set correct Result to RegionActionResult for successful Put/Delete mutations

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      While returning response of multi(), RSRpcServices build the RegionActionResult with Result or Exception (ClientProtos.ResultOrException). It sets the Exception to this class in all cases where the operation fails with corresponding exception types e.g. NoSuchColumnFamilyException or FailedSanityCheckException etc.

      In case of atomic mutations Increment and Append, we add the Result object to ClientProtos.ResultOrException, which is used by client to retrieve result from the batch API: Table#batch(List<? extends Row> actions, Object[] results).

      Phoenix performs atomic mutation for Put using preBatchMutate() endpoint. Hence, returning Result object with ResultOrException is important for the purpose of returning the result back to the client as part of the atomic operation. Even if Phoenix returns the OperationStatus (with Result) to MiniBatchOperationInProgress, since HBase uses the empty Result for the Success case, the client would not be able to get the expected result.

      case SUCCESS:
        builder.addResultOrException(
          getResultOrException(ClientProtos.Result.getDefaultInstance(), index));
        break; 

      If OperationStatus returned by Region#batchMutate has valid Result object, it should be used by RSRpcServices while returning the response.

      Attachments

        Issue Links

          Activity

            People

              jingyu Jing Yu
              vjasani Viraj Jasani
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: