From e39fd6d11b6c8404d5da32ac46e72882c0f0b587 Mon Sep 17 00:00:00 2001
From: Michael Stack
Date: Tue, 26 May 2020 19:50:23 -0700
Subject: [PATCH] HBASE-24425 Run hbck_chore_run and catalogjanitor_run on draw
of 'HBCK Report' page (#1771)
Signed-off-by: clarax
Signed-off-by: Viraj Jasani
Signed-off-by: Jan Hentschel
Signed-off-by: Huaxiang Sun
---
.../resources/hbase-webapps/master/hbck.jsp | 33 ++++++++++++++++---
1 file changed, 28 insertions(+), 5 deletions(-)
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 c3c11e5210b..87d0018171a 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/hbck.jsp
@@ -38,8 +38,22 @@
<%@ page import="org.apache.hadoop.hbase.master.CatalogJanitor" %>
<%@ page import="org.apache.hadoop.hbase.master.CatalogJanitor.Report" %>
<%
+ final String cacheParameterValue = request.getParameter("cache");
final HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER);
pageContext.setAttribute("pageTitle", "HBase Master HBCK Report: " + master.getServerName());
+ if (!Boolean.parseBoolean(cacheParameterValue)) {
+ // Run the two reporters inline w/ drawing of the page. If exception, will show in page draw.
+ try {
+ master.getMasterRpcServices().runHbckChore(null, null);
+ } catch (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException se) {
+ out.write("Failed generating a new hbck_chore report; using cache; try again or run hbck_chore_run in the shell: " + se.getMessage() + "\n");
+ }
+ try {
+ master.getMasterRpcServices().runCatalogScan(null, null);
+ } catch (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException se) {
+ out.write("Failed generating a new catalogjanitor report; using cache; try again or run catalogjanitor_run in the shell: " + se.getMessage() + "\n");
+ }
+ }
HbckChore hbckChore = master.getHbckChore();
Map>> inconsistentRegions = null;
Map orphanRegionsOnRS = null;
@@ -79,7 +93,16 @@
@@ -89,11 +112,11 @@
<% if (hbckChore.isDisabled()) { %>
HBCK chore is currently disabled. Set hbase.master.hbck.chore.interval > 0 in the config & do a rolling-restart to enable it.
<% } else if (startTimestamp == 0 && endTimestamp == 0){ %>
- No report created. Execute hbck_chore_run in hbase shell to generate a new sub-report.
+ No report created.
<% } else if (startTimestamp > 0 && endTimestamp == 0){ %>
Checking started at <%= iso8601start %>. Please wait for checking to generate a new sub-report.
<% } else { %>
- Checking started at <%= iso8601start %> and generated report at <%= iso8601end %>. Execute hbck_chore_run in hbase shell to generate a new sub-report.
+ Checking started at <%= iso8601start %> and generated report at <%= iso8601end %>.
<% } %>
@@ -204,9 +227,9 @@
CatalogJanitor hbase:meta Consistency Issues
<% if (report != null) { %>
- Report created: <%= iso8601reportTime %> (now=<%= iso8601Now %>). Run catalogjanitor_run in hbase shell to generate a new sub-report.
+ Report created: <%= iso8601reportTime %> (now=<%= iso8601Now %>).
<% } else { %>
- No report created. Run catalogjanitor_run in hbase shell to generate a new sub-report.
+ No report created.
<% } %>