You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2021/06/27 14:44:36 UTC

[hbase] branch branch-2.4 updated: HBASE-25980 Master table.jsp pointed at meta throws 500 when no all r… (#3373)

This is an automated email from the ASF dual-hosted git repository.

zhangduo 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 270b3fa  HBASE-25980 Master table.jsp pointed at meta throws 500 when no all r… (#3373)
270b3fa is described below

commit 270b3facce464d6f7f531e4478db1eb2ab2fcac7
Author: GeorryHuang <21...@qq.com>
AuthorDate: Sun Jun 27 22:30:46 2021 +0800

    HBASE-25980 Master table.jsp pointed at meta throws 500 when no all r… (#3373)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 .../main/resources/hbase-webapps/master/table.jsp  | 33 +++++++++++++++++++---
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
index 9c31d22..2b4b73f 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
@@ -61,7 +61,8 @@
   import="org.apache.hadoop.hbase.master.webapp.MetaBrowser"
   import="org.apache.hadoop.hbase.master.webapp.RegionReplicaInfo"
   import="org.apache.hadoop.hbase.quotas.QuotaSettingsFactory"
-  import="org.apache.hadoop.hbase.quotas.QuotaTableUtil"%>
+  import="org.apache.hadoop.hbase.quotas.QuotaTableUtil"
+  import="org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException" %>
 <%@ page import="org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot" %>
 <%@ page import="org.apache.hadoop.hbase.quotas.ThrottleSettings" %>
 <%@ page import="org.apache.hadoop.hbase.util.Bytes" %>
@@ -268,8 +269,16 @@
               for (int j = 0; j < numMetaReplicas; j++) {
                 RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
                         RegionInfoBuilder.FIRST_META_REGIONINFO, j);
-                ServerName metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
+                //If a metaLocation is null, All of its info would be empty here to be displayed.
+                ServerName metaLocation = null;
+                try {
+                  metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
+                } catch (NotAllMetaRegionsOnlineException e) {
+                  //Region in transition state here throw a NotAllMetaRegionsOnlineException causes
+                  //the UI crash.
+                }
                 for (int i = 0; i < 1; i++) {
+                  //If metaLocation is null, default value below would be displayed in UI.
                   String hostAndPort = "";
                   String readReq = "N/A";
                   String writeReq = "N/A";
@@ -338,8 +347,16 @@
                for (int j = 0; j < numMetaReplicas; j++) {
                  RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
                                          RegionInfoBuilder.FIRST_META_REGIONINFO, j);
-                 ServerName metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
+                 //If a metaLocation is null, All of its info would be empty here to be displayed.
+                 ServerName metaLocation = null;
+                 try {
+                   metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
+                 } catch (NotAllMetaRegionsOnlineException e) {
+                   //Region in transition state here throw a NotAllMetaRegionsOnlineException causes
+                   //the UI crash.
+                 }
                  for (int i = 0; i < 1; i++) {
+                   //If metaLocation is null, default value below would be displayed in UI.
                    String hostAndPort = "";
                    float locality = 0.0f;
                    float localityForSsd = 0.0f;
@@ -385,8 +402,16 @@
               for (int j = 0; j < numMetaReplicas; j++) {
                 RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
                         RegionInfoBuilder.FIRST_META_REGIONINFO, j);
-                ServerName metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
+                //If a metaLocation is null, All of its info would be empty here to be displayed.
+                ServerName metaLocation = null;
+                try {
+                  metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
+                } catch (NotAllMetaRegionsOnlineException e) {
+                  //Region in transition state here throw a NotAllMetaRegionsOnlineException causes
+                  //the UI crash.
+                }
                 for (int i = 0; i < 1; i++) {
+                  //If metaLocation is null, default value below would be displayed in UI.
                   String hostAndPort = "";
                   long compactingCells = 0;
                   long compactedCells = 0;