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

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • None
    • 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

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

          People

            brfrn169 Toshihiro Suzuki
            brfrn169 Toshihiro Suzuki
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment