From bfa19f3a5ac90a02c8e3c82d6d2e65df71b78879 Mon Sep 17 00:00:00 2001 From: stack Date: Tue, 3 Sep 2019 14:48:04 -0700 Subject: [PATCH] HBASE-22970 split parents show as overlaps in the HBCK Report Check if overlap is split parent. Cleaned up the HBCK Report page too with some notes that it is made of two reports; have the two sections display the same. --- .../hadoop/hbase/client/RegionInfo.java | 4 +- .../resources/hbase-webapps/master/hbck.jsp | 39 ++++++++++++------- .../hbase/regionserver/TestHRegionInfo.java | 7 ++++ 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionInfo.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionInfo.java index f2829e8ec82..80569002cae 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionInfo.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionInfo.java @@ -799,11 +799,11 @@ public interface RegionInfo { } int startKeyCompare = Bytes.compareTo(getStartKey(), other.getStartKey()); if (startKeyCompare == 0) { - return true; + return !this.isSplitParent(); } if (startKeyCompare < 0) { if (isLast()) { - return true; + return !this.isSplitParent(); } return Bytes.compareTo(getEndKey(), other.getStartKey()) > 0; } diff --git a/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp b/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp index a003e5fe096..6ae5d68f68d 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp @@ -76,6 +76,11 @@ <% } else { %> +
+ +
+ + <% if (inconsistentRegions != null && inconsistentRegions.size() > 0) { %>
- - <% if (inconsistentRegions != null && inconsistentRegions.size() > 0) { %>

There are three cases: 1. Master thought this region opened, but no regionserver reported it (Fix: use assigns @@ -127,13 +132,13 @@ <% } %> + <% if (orphanRegionsOnRS != null && orphanRegionsOnRS.size() > 0) { %>

- <% if (orphanRegionsOnRS != null && orphanRegionsOnRS.size() > 0) { %> @@ -150,13 +155,13 @@
Region Encoded Name
<% } %> + <% if (orphanRegionsOnFS != null && orphanRegionsOnFS.size() > 0) { %>
- <% if (orphanRegionsOnFS != null && orphanRegionsOnFS.size() > 0) { %> @@ -173,20 +178,24 @@
Region Encoded Name
<% } %> -
- -
- <% if (report != null && !report.isEmpty()) { - zdt = ZonedDateTime.ofInstant(Instant.ofEpochMilli(report.getCreateTime()), - ZoneId.systemDefault()); - String iso8601reportTime = zdt.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + <% zdt = ZonedDateTime.ofInstant(Instant.ofEpochMilli(System.currentTimeMillis()), ZoneId.systemDefault()); String iso8601Now = zdt.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + String iso8601reportTime = "-1"; + if (report != null) { + zdt = ZonedDateTime.ofInstant(Instant.ofEpochMilli(report.getCreateTime()), + ZoneId.systemDefault()); + iso8601reportTime = zdt.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } %> -

Report created: <%= iso8601reportTime %> (now=<%= iso8601Now %>). Run catalogjanitor_run in hbase shell to generate a new sub-report.

+
+ +
+ <% if (report != null && !report.isEmpty()) { %> <% if (!report.getHoles().isEmpty()) { %>