You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by vj...@apache.org on 2023/10/11 04:52:24 UTC
[hbase] branch branch-3 updated: HBASE-28144 Canary publish read failure fails with NPE if region location is null (#5456)
This is an automated email from the ASF dual-hosted git repository.
vjasani pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-3 by this push:
new d45d0c2a976 HBASE-28144 Canary publish read failure fails with NPE if region location is null (#5456)
d45d0c2a976 is described below
commit d45d0c2a97687b4ba4f8d5992c43bb45a5d86de3
Author: Viraj Jasani <vj...@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 <wc...@apache.org>
Signed-off-by: David Manning <da...@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 12cb90c08e6..d5676263c82 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,