[14/34] hbase git commit: HBASE-19774 incorrect behavior of locateRegionInMeta
HBASE-19774 incorrect behavior of locateRegionInMeta Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/be496ba8 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/be496ba8 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/be496ba8 Branch: refs/heads/HBASE-19064 Commit: be496ba8ea6a60702387f653a4fb7f0d8d11ec34 Parents: 3a1e433 Author: Sergey Soldatov Authored: Thu Jan 11 13:40:38 2018 -0800 Committer: Michael Stack Committed: Mon Jan 22 11:48:55 2018 -0800 -- .../hbase/client/ConnectionImplementation.java | 23 - .../client/TestScannersFromClientSide.java | 50 +++- 2 files changed, 49 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/be496ba8/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java index 562630f..8807884 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java @@ -786,11 +786,14 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // build the key of the meta region we should be looking for. // the extra 9's on the end are necessary to allow "exact" matches // without knowing the precise region names. -byte[] metaKey = RegionInfo.createRegionName(tableName, row, HConstants.NINES, false); +byte[] metaStartKey = RegionInfo.createRegionName(tableName, row, HConstants.NINES, false); +byte[] metaStopKey = + RegionInfo.createRegionName(tableName, HConstants.EMPTY_START_ROW, "", false); Scan s = new Scan(); s.setReversed(true); -s.withStartRow(metaKey); +s.withStartRow(metaStartKey); +s.withStopRow(metaStopKey, true); s.addFamily(HConstants.CATALOG_FAMILY); if (this.useMetaReplicas) { @@ -840,12 +843,11 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // convert the row result into the HRegionLocation we need! RegionLocations locations = MetaTableAccessor.getRegionLocations(regionInfoRow); if (locations == null || locations.getRegionLocation(replicaId) == null) { - throw new IOException("HRegionInfo was null in " + -tableName + ", row=" + regionInfoRow); + throw new IOException("RegionInfo null in " + tableName + ", row=" + regionInfoRow); } RegionInfo regionInfo = locations.getRegionLocation(replicaId).getRegion(); if (regionInfo == null) { - throw new IOException("HRegionInfo was null or empty in " + + throw new IOException("RegionInfo null or empty in " + TableName.META_TABLE_NAME + ", row=" + regionInfoRow); } @@ -857,13 +859,12 @@ class ConnectionImplementation implements ClusterConnection, Closeable { "hbase:meta might be damaged."); } if (regionInfo.isSplit()) { - throw new RegionOfflineException( - "the only available region for the required row is a split parent," - + " the daughters should be online soon: " + regionInfo.getRegionNameAsString()); + throw new RegionOfflineException ("Region for row is a split parent, daughters not online: " + + regionInfo.getRegionNameAsString()); } if (regionInfo.isOffline()) { - throw new RegionOfflineException("the region is offline, could" - + " be caused by a disable table call: " + regionInfo.getRegionNameAsString()); + throw new RegionOfflineException("Region offline; disable table call? " + + regionInfo.getRegionNameAsString()); } ServerName serverName = locations.getRegionLocation(replicaId).getServerName(); @@ -908,7 +909,7 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // Only relocate the parent region if necessary if(!(e instanceof RegionOfflineException || e instanceof NoServerForRegionException)) { - relocateRegion(TableName.META_TABLE_NAME, metaKey, replicaId); + relocateRegion(TableName.META_TABLE_NAME, metaStartKey, replicaId); } } finally { userRegionLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/be496ba8/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java -- diff --git a/hb
[01/50] [abbrv] hbase git commit: HBASE-19774 incorrect behavior of locateRegionInMeta [Forced Update!]
Repository: hbase Updated Branches: refs/heads/HBASE-19397-branch-2 46a9db935 -> 7aaad6f4c (forced update) HBASE-19774 incorrect behavior of locateRegionInMeta Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6f8c3124 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6f8c3124 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6f8c3124 Branch: refs/heads/HBASE-19397-branch-2 Commit: 6f8c31242a211e09acabd8b2c0a5d264839f72af Parents: 5f62041 Author: Sergey Soldatov Authored: Thu Jan 11 13:40:38 2018 -0800 Committer: Michael Stack Committed: Mon Jan 22 11:49:19 2018 -0800 -- .../hbase/client/ConnectionImplementation.java | 23 - .../client/TestScannersFromClientSide.java | 50 +++- 2 files changed, 49 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/6f8c3124/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java index 562630f..8807884 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java @@ -786,11 +786,14 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // build the key of the meta region we should be looking for. // the extra 9's on the end are necessary to allow "exact" matches // without knowing the precise region names. -byte[] metaKey = RegionInfo.createRegionName(tableName, row, HConstants.NINES, false); +byte[] metaStartKey = RegionInfo.createRegionName(tableName, row, HConstants.NINES, false); +byte[] metaStopKey = + RegionInfo.createRegionName(tableName, HConstants.EMPTY_START_ROW, "", false); Scan s = new Scan(); s.setReversed(true); -s.withStartRow(metaKey); +s.withStartRow(metaStartKey); +s.withStopRow(metaStopKey, true); s.addFamily(HConstants.CATALOG_FAMILY); if (this.useMetaReplicas) { @@ -840,12 +843,11 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // convert the row result into the HRegionLocation we need! RegionLocations locations = MetaTableAccessor.getRegionLocations(regionInfoRow); if (locations == null || locations.getRegionLocation(replicaId) == null) { - throw new IOException("HRegionInfo was null in " + -tableName + ", row=" + regionInfoRow); + throw new IOException("RegionInfo null in " + tableName + ", row=" + regionInfoRow); } RegionInfo regionInfo = locations.getRegionLocation(replicaId).getRegion(); if (regionInfo == null) { - throw new IOException("HRegionInfo was null or empty in " + + throw new IOException("RegionInfo null or empty in " + TableName.META_TABLE_NAME + ", row=" + regionInfoRow); } @@ -857,13 +859,12 @@ class ConnectionImplementation implements ClusterConnection, Closeable { "hbase:meta might be damaged."); } if (regionInfo.isSplit()) { - throw new RegionOfflineException( - "the only available region for the required row is a split parent," - + " the daughters should be online soon: " + regionInfo.getRegionNameAsString()); + throw new RegionOfflineException ("Region for row is a split parent, daughters not online: " + + regionInfo.getRegionNameAsString()); } if (regionInfo.isOffline()) { - throw new RegionOfflineException("the region is offline, could" - + " be caused by a disable table call: " + regionInfo.getRegionNameAsString()); + throw new RegionOfflineException("Region offline; disable table call? " + + regionInfo.getRegionNameAsString()); } ServerName serverName = locations.getRegionLocation(replicaId).getServerName(); @@ -908,7 +909,7 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // Only relocate the parent region if necessary if(!(e instanceof RegionOfflineException || e instanceof NoServerForRegionException)) { - relocateRegion(TableName.META_TABLE_NAME, metaKey, replicaId); + relocateRegion(TableName.META_TABLE_NAME, metaStartKey, replicaId); } } finally { userRegionLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/6f8c3124/hbase-server/src/test/java/org/apache/hadoop/hbase/client
hbase git commit: HBASE-19774 incorrect behavior of locateRegionInMeta
Repository: hbase Updated Branches: refs/heads/branch-2 5f62041cb -> 6f8c31242 HBASE-19774 incorrect behavior of locateRegionInMeta Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6f8c3124 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6f8c3124 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6f8c3124 Branch: refs/heads/branch-2 Commit: 6f8c31242a211e09acabd8b2c0a5d264839f72af Parents: 5f62041 Author: Sergey Soldatov Authored: Thu Jan 11 13:40:38 2018 -0800 Committer: Michael Stack Committed: Mon Jan 22 11:49:19 2018 -0800 -- .../hbase/client/ConnectionImplementation.java | 23 - .../client/TestScannersFromClientSide.java | 50 +++- 2 files changed, 49 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/6f8c3124/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java index 562630f..8807884 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java @@ -786,11 +786,14 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // build the key of the meta region we should be looking for. // the extra 9's on the end are necessary to allow "exact" matches // without knowing the precise region names. -byte[] metaKey = RegionInfo.createRegionName(tableName, row, HConstants.NINES, false); +byte[] metaStartKey = RegionInfo.createRegionName(tableName, row, HConstants.NINES, false); +byte[] metaStopKey = + RegionInfo.createRegionName(tableName, HConstants.EMPTY_START_ROW, "", false); Scan s = new Scan(); s.setReversed(true); -s.withStartRow(metaKey); +s.withStartRow(metaStartKey); +s.withStopRow(metaStopKey, true); s.addFamily(HConstants.CATALOG_FAMILY); if (this.useMetaReplicas) { @@ -840,12 +843,11 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // convert the row result into the HRegionLocation we need! RegionLocations locations = MetaTableAccessor.getRegionLocations(regionInfoRow); if (locations == null || locations.getRegionLocation(replicaId) == null) { - throw new IOException("HRegionInfo was null in " + -tableName + ", row=" + regionInfoRow); + throw new IOException("RegionInfo null in " + tableName + ", row=" + regionInfoRow); } RegionInfo regionInfo = locations.getRegionLocation(replicaId).getRegion(); if (regionInfo == null) { - throw new IOException("HRegionInfo was null or empty in " + + throw new IOException("RegionInfo null or empty in " + TableName.META_TABLE_NAME + ", row=" + regionInfoRow); } @@ -857,13 +859,12 @@ class ConnectionImplementation implements ClusterConnection, Closeable { "hbase:meta might be damaged."); } if (regionInfo.isSplit()) { - throw new RegionOfflineException( - "the only available region for the required row is a split parent," - + " the daughters should be online soon: " + regionInfo.getRegionNameAsString()); + throw new RegionOfflineException ("Region for row is a split parent, daughters not online: " + + regionInfo.getRegionNameAsString()); } if (regionInfo.isOffline()) { - throw new RegionOfflineException("the region is offline, could" - + " be caused by a disable table call: " + regionInfo.getRegionNameAsString()); + throw new RegionOfflineException("Region offline; disable table call? " + + regionInfo.getRegionNameAsString()); } ServerName serverName = locations.getRegionLocation(replicaId).getServerName(); @@ -908,7 +909,7 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // Only relocate the parent region if necessary if(!(e instanceof RegionOfflineException || e instanceof NoServerForRegionException)) { - relocateRegion(TableName.META_TABLE_NAME, metaKey, replicaId); + relocateRegion(TableName.META_TABLE_NAME, metaStartKey, replicaId); } } finally { userRegionLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/6f8c3124/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java ---
hbase git commit: HBASE-19774 incorrect behavior of locateRegionInMeta
Repository: hbase Updated Branches: refs/heads/master 3a1e433ad -> be496ba8e HBASE-19774 incorrect behavior of locateRegionInMeta Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/be496ba8 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/be496ba8 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/be496ba8 Branch: refs/heads/master Commit: be496ba8ea6a60702387f653a4fb7f0d8d11ec34 Parents: 3a1e433 Author: Sergey Soldatov Authored: Thu Jan 11 13:40:38 2018 -0800 Committer: Michael Stack Committed: Mon Jan 22 11:48:55 2018 -0800 -- .../hbase/client/ConnectionImplementation.java | 23 - .../client/TestScannersFromClientSide.java | 50 +++- 2 files changed, 49 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/be496ba8/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java index 562630f..8807884 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java @@ -786,11 +786,14 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // build the key of the meta region we should be looking for. // the extra 9's on the end are necessary to allow "exact" matches // without knowing the precise region names. -byte[] metaKey = RegionInfo.createRegionName(tableName, row, HConstants.NINES, false); +byte[] metaStartKey = RegionInfo.createRegionName(tableName, row, HConstants.NINES, false); +byte[] metaStopKey = + RegionInfo.createRegionName(tableName, HConstants.EMPTY_START_ROW, "", false); Scan s = new Scan(); s.setReversed(true); -s.withStartRow(metaKey); +s.withStartRow(metaStartKey); +s.withStopRow(metaStopKey, true); s.addFamily(HConstants.CATALOG_FAMILY); if (this.useMetaReplicas) { @@ -840,12 +843,11 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // convert the row result into the HRegionLocation we need! RegionLocations locations = MetaTableAccessor.getRegionLocations(regionInfoRow); if (locations == null || locations.getRegionLocation(replicaId) == null) { - throw new IOException("HRegionInfo was null in " + -tableName + ", row=" + regionInfoRow); + throw new IOException("RegionInfo null in " + tableName + ", row=" + regionInfoRow); } RegionInfo regionInfo = locations.getRegionLocation(replicaId).getRegion(); if (regionInfo == null) { - throw new IOException("HRegionInfo was null or empty in " + + throw new IOException("RegionInfo null or empty in " + TableName.META_TABLE_NAME + ", row=" + regionInfoRow); } @@ -857,13 +859,12 @@ class ConnectionImplementation implements ClusterConnection, Closeable { "hbase:meta might be damaged."); } if (regionInfo.isSplit()) { - throw new RegionOfflineException( - "the only available region for the required row is a split parent," - + " the daughters should be online soon: " + regionInfo.getRegionNameAsString()); + throw new RegionOfflineException ("Region for row is a split parent, daughters not online: " + + regionInfo.getRegionNameAsString()); } if (regionInfo.isOffline()) { - throw new RegionOfflineException("the region is offline, could" - + " be caused by a disable table call: " + regionInfo.getRegionNameAsString()); + throw new RegionOfflineException("Region offline; disable table call? " + + regionInfo.getRegionNameAsString()); } ServerName serverName = locations.getRegionLocation(replicaId).getServerName(); @@ -908,7 +909,7 @@ class ConnectionImplementation implements ClusterConnection, Closeable { // Only relocate the parent region if necessary if(!(e instanceof RegionOfflineException || e instanceof NoServerForRegionException)) { - relocateRegion(TableName.META_TABLE_NAME, metaKey, replicaId); + relocateRegion(TableName.META_TABLE_NAME, metaStartKey, replicaId); } } finally { userRegionLock.unlock(); http://git-wip-us.apache.org/repos/asf/hbase/blob/be496ba8/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java ---