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.
This commit is contained in:
parent
e50ec76ac4
commit
960a5fdc2a
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -76,6 +76,11 @@
|
|||
<jsp:include page="redirect.jsp" />
|
||||
<% } else { %>
|
||||
|
||||
<div class="row">
|
||||
<div class="page-header">
|
||||
<p><span>This page displays two reports. Only the report titles show if reports are empty.</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="page-header">
|
||||
<h1>HBCK Chore Report</h1>
|
||||
|
@ -83,20 +88,20 @@
|
|||
<% if (hbckChore.isDisabled()) { %>
|
||||
<span>HBCK chore is currently disabled. Set hbase.master.hbck.chore.interval > 0 in the config & do a rolling-restart to enable it.</span>
|
||||
<% } else { %>
|
||||
<span>Checking started at <%= iso8601start %> and generated report at <%= iso8601end %>. Execute 'hbck_chore_run' in hbase shell to generate a new sub-report.</span>
|
||||
<span>Checking started at <%= iso8601start %> and generated report at <%= iso8601end %>. Execute <i>hbck_chore_run</i> in hbase shell to generate a new sub-report.</span>
|
||||
<% } %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<% if (inconsistentRegions != null && inconsistentRegions.size() > 0) { %>
|
||||
<div class="row">
|
||||
<div class="page-header">
|
||||
<h2>Inconsistent Regions</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if (inconsistentRegions != null && inconsistentRegions.size() > 0) { %>
|
||||
<p>
|
||||
<span>
|
||||
There are three cases: 1. Master thought this region opened, but no regionserver reported it (Fix: use assigns
|
||||
|
@ -127,13 +132,13 @@
|
|||
</table>
|
||||
<% } %>
|
||||
|
||||
<% if (orphanRegionsOnRS != null && orphanRegionsOnRS.size() > 0) { %>
|
||||
<div class="row">
|
||||
<div class="page-header">
|
||||
<h2>Orphan Regions on RegionServer</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if (orphanRegionsOnRS != null && orphanRegionsOnRS.size() > 0) { %>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Region Encoded Name</th>
|
||||
|
@ -150,13 +155,13 @@
|
|||
</table>
|
||||
<% } %>
|
||||
|
||||
<% if (orphanRegionsOnFS != null && orphanRegionsOnFS.size() > 0) { %>
|
||||
<div class="row">
|
||||
<div class="page-header">
|
||||
<h2>Orphan Regions on FileSystem</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if (orphanRegionsOnFS != null && orphanRegionsOnFS.size() > 0) { %>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Region Encoded Name</th>
|
||||
|
@ -173,20 +178,24 @@
|
|||
</table>
|
||||
<% } %>
|
||||
|
||||
<div class="row inner_header">
|
||||
<div class="page-header">
|
||||
<h1>CatalogJanitor <em>hbase:meta</em> Consistency Issues</h1>
|
||||
</div>
|
||||
</div>
|
||||
<% 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);
|
||||
}
|
||||
%>
|
||||
<p>Report created: <%= iso8601reportTime %> (now=<%= iso8601Now %>). Run <i>catalogjanitor_run</i> in hbase shell to generate a new sub-report.</p>
|
||||
<div class="row inner_header">
|
||||
<div class="page-header">
|
||||
<h1>CatalogJanitor <em>hbase:meta</em> Consistency Issues</h1>
|
||||
<p><span>Report created: <%= iso8601reportTime %> (now=<%= iso8601Now %>). Run <i>catalogjanitor_run</i> in hbase shell to generate a new sub-report.</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<% if (report != null && !report.isEmpty()) { %>
|
||||
<% if (!report.getHoles().isEmpty()) { %>
|
||||
<div class="row inner_header">
|
||||
<div class="page-header">
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
|
|||
import org.apache.hadoop.hbase.HRegionInfo;
|
||||
import org.apache.hadoop.hbase.HTableDescriptor;
|
||||
import org.apache.hadoop.hbase.TableName;
|
||||
import org.apache.hadoop.hbase.client.RegionInfo;
|
||||
import org.apache.hadoop.hbase.client.RegionInfoBuilder;
|
||||
import org.apache.hadoop.hbase.exceptions.DeserializationException;
|
||||
import org.apache.hadoop.hbase.master.RegionState;
|
||||
|
@ -127,6 +128,12 @@ public class TestHRegionInfo {
|
|||
assertTrue(abri.isOverlap(adri));
|
||||
assertFalse(dri.isOverlap(ari));
|
||||
assertTrue(abri.isOverlap(adri));
|
||||
assertTrue(adri.isOverlap(abri));
|
||||
// Check that splitParent is not reported as an overlap.
|
||||
RegionInfo splitParent = RegionInfoBuilder.newBuilder(adri.getTable()).
|
||||
setStartKey(adri.getStartKey()).setEndKey(adri.getEndKey()).setOffline(true).
|
||||
setSplit(true).build();
|
||||
assertFalse(splitParent.isOverlap(abri));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue