[ https://issues.apache.org/jira/browse/HBASE-20229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16407290#comment-16407290 ]
Toshihiro Suzuki commented on HBASE-20229: ------------------------------------------ [~anoop.hbase] [~huaxiang] Sorry for my lack of explanation. The issue is when region replication is on, ConnectionImplementation.locateRegions() returns wrong results. In the test in my patch, the table should have 1 primary region + 2 secondaries, but ConnectionImplementation.locateRegions() returns 9 regions. I think this is because the following code calls locateRegion() even for replica regions and then the result tripled. {code} 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); } } } {code} The fix in my patch is to make it call locateRegion() only for a primary region. Thanks > ConnectionImplementation.locateRegions() doesn't work correctly when region > replication is on > --------------------------------------------------------------------------------------------- > > Key: HBASE-20229 > URL: https://issues.apache.org/jira/browse/HBASE-20229 > Project: HBase > Issue Type: Bug > Reporter: Toshihiro Suzuki > Assignee: Toshihiro Suzuki > Priority: Major > Attachments: HBASE-20229.master.001.patch > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)