This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch branch-2.4 in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.4 by this push: new dd13e6416d8 HBASE-28144 Canary publish read failure fails with NPE if region location is null (#5456) dd13e6416d8 is described below commit dd13e6416d8b7cf80fe8da5d8d115a11ef191dc8 Author: Viraj Jasani <vjas...@apache.org> AuthorDate: Tue Oct 10 20:51:04 2023 -0800 HBASE-28144 Canary publish read failure fails with NPE if region location is null (#5456) Signed-off-by: Wellington Chevreuil <wchevre...@apache.org> Signed-off-by: David Manning <david.mann...@salesforce.com> --- .../org/apache/hadoop/hbase/tool/CanaryTool.java | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java index dc63f4e4d68..32b47dab7da 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java @@ -323,13 +323,15 @@ public class CanaryTool implements Tool, Canary { } private void incFailuresCountDetails(ServerName serverName, RegionInfo region) { - perServerFailuresCount.compute(serverName, (server, count) -> { - if (count == null) { - count = new LongAdder(); - } - count.increment(); - return count; - }); + if (serverName != null) { + perServerFailuresCount.compute(serverName, (server, count) -> { + if (count == null) { + count = new LongAdder(); + } + count.increment(); + return count; + }); + } perTableFailuresCount.compute(region.getTable().getNameAsString(), (tableName, count) -> { if (count == null) { count = new LongAdder(); @@ -340,18 +342,18 @@ public class CanaryTool implements Tool, Canary { } public void publishReadFailure(ServerName serverName, RegionInfo region, Exception e) { - incReadFailureCount(); - incFailuresCountDetails(serverName, region); LOG.error("Read from {} on serverName={} failed", region.getRegionNameAsString(), serverName, e); + incReadFailureCount(); + incFailuresCountDetails(serverName, region); } public void publishReadFailure(ServerName serverName, RegionInfo region, ColumnFamilyDescriptor column, Exception e) { - incReadFailureCount(); - incFailuresCountDetails(serverName, region); LOG.error("Read from {} on serverName={}, columnFamily={} failed", region.getRegionNameAsString(), serverName, column.getNameAsString(), e); + incReadFailureCount(); + incFailuresCountDetails(serverName, region); } public void publishReadTiming(ServerName serverName, RegionInfo region, @@ -368,17 +370,17 @@ public class CanaryTool implements Tool, Canary { } public void publishWriteFailure(ServerName serverName, RegionInfo region, Exception e) { + LOG.error("Write to {} on {} failed", region.getRegionNameAsString(), serverName, e); incWriteFailureCount(); incFailuresCountDetails(serverName, region); - LOG.error("Write to {} on {} failed", region.getRegionNameAsString(), serverName, e); } public void publishWriteFailure(ServerName serverName, RegionInfo region, ColumnFamilyDescriptor column, Exception e) { - incWriteFailureCount(); - incFailuresCountDetails(serverName, region); LOG.error("Write to {} on {} {} failed", region.getRegionNameAsString(), serverName, column.getNameAsString(), e); + incWriteFailureCount(); + incFailuresCountDetails(serverName, region); } public void publishWriteTiming(ServerName serverName, RegionInfo region,