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

ConnectionImplementation.locateRegions() returns duplicated entries when region replication is on

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      The issue is when region replication is on, ConnectionImplementation.locateRegions() returns duplicated entries.

      In the test in my patch, the table should have 1 primary region + 2 secondaries, but ConnectionImplementation.locateRegions() returns 9 regions. Every region repeats 3 times (3 = replicas count).

      I think this is because the following code calls locateRegion() even for replica regions and then the result triples.

          for (RegionInfo regionInfo : regions) {
            RegionLocations list = locateRegion(tableName, regionInfo.getStartKey(), useCache, true);
            if (list != null) {
              for (HRegionLocation loc : list.getRegionLocations()) {
                if (loc != null) {
                  locations.add(loc);
                }
              }
            }
      

      The fix in my patch is to make it call locateRegion() only for a primary region.

        Attachments

        1. HBASE-20229.branch-1.001.patch
          4 kB
          Toshihiro Suzuki
        2. HBASE-20229.branch-1.002.patch
          4 kB
          Toshihiro Suzuki
        3. HBASE-20229.branch-1.002.patch
          4 kB
          Toshihiro Suzuki
        4. HBASE-20229.master.001.patch
          3 kB
          Toshihiro Suzuki
        5. HBASE-20229.master.002.patch
          4 kB
          Toshihiro Suzuki
        6. HBASE-20229.master.003.patch
          4 kB
          Toshihiro Suzuki
        7. HBASE-20229.master.004.patch
          4 kB
          Toshihiro Suzuki

          Activity

            People

            • Assignee:
              brfrn169 Toshihiro Suzuki
              Reporter:
              brfrn169 Toshihiro Suzuki

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment