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

ReversedScannerCallable invokes getRegionLocations incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.0.0-alpha-1, 1.4.0, 1.3.2, 1.5.0, 1.1.13, 2.0.0, 1.2.7
    • 1.4.0, 1.3.2, 2.0.0-alpha-3, 1.1.13, 2.0.0, 1.2.7
    • None
    • None
    • Reviewed
    • Performing reverse scan on tables used the meta cache incorrectly and fetched data from meta table every time. This fix solves this issue and which results in performance improvement for reverse scans.

    Description

      The behavior of ReversedScannerCallable#prepare [1] and ScannerCallable#prepare [2] methods differ how they call RpcRetryingCallerWithReadReplicas.getRegionLocations method.

      The reversed scanner uses the 'reload' parameter directly as the first argument - RpcRetryingCallerWithReadReplicas.getRegionLocations(reload, id, getConnection(), getTableName(), getRow()) - however, the forward scanner passes '!reload'. The getRegionLocations first parameter is 'useCache', the way we use it in ScannerCallable is the correct one.

      The same call can be found in ReversedScannerCallable#locateRegionsInRange [3] also without negating its value.

      [1] https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ReversedScannerCallable.java#L89-L90
      [2] https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java#L139-L140
      [3] https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ReversedScannerCallable.java#L143-L144

      Attachments

        1. HBASE-18665.master.001.patch
          7 kB
          Peter Somogyi
        2. HBASE-18665.master.002.patch
          8 kB
          Peter Somogyi
        3. HBASE-18665.branch-1.003.patch
          9 kB
          Peter Somogyi
        4. HBASE-18665.master.003.patch
          8 kB
          Peter Somogyi
        5. HBASE-18665.branch-1.003.patch
          9 kB
          Peter Somogyi
        6. 18665.master.003.patch
          8 kB
          Ted Yu
        7. HBASE-18665.master.003.patch
          8 kB
          Peter Somogyi
        8. HBASE-18665.branch-1.3.003.patch
          8 kB
          Peter Somogyi
        9. HBASE-18665.branch-1.3.004.patch
          8 kB
          Peter Somogyi

        Activity

          People

            psomogyi Peter Somogyi
            psomogyi Peter Somogyi
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: