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

Batch Append/Increment will always fail if set ReturnResults to false

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.1.5, 1.2.2, 2.0.0
    • 2.0.0
    • API
    • None
    • Reviewed

    Description

      If set Append/Increment's ReturnResult attribute to false, and batch the appends/increments to server. The batch operation will always return false.
      The reason is that, since return result is set to false, append/increment will return null instead of Result object. But in ResponseConverter#getResults, there is some check code

      if (requestRegionActionCount != responseRegionActionResultCount) {
            throw new IllegalStateException("Request mutation count=" + requestRegionActionCount +
                " does not match response mutation result count=" + responseRegionActionResultCount);
          }
      

      That means if the result count is not meet with request mutation count, it will fail the request.
      The solution is simple, instead of returning a null result, returning a empty result if ReturnResult set to false.

      Attachments

        1. FailedCase.java
          3 kB
          Allan Yang
        2. HBASE-16283.patch
          3 kB
          Allan Yang
        3. HBASE-16283v2.patch
          3 kB
          Allan Yang
        4. HBASE-16283v3.patch
          6 kB
          Allan Yang

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            allan163 Allan Yang
            allan163 Allan Yang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment