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

guluo2016 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 b65644013ac HBASE-30284 FNFE when viewing MOB Files of a MOB table 
restored from snapshot in HBase UI (#8466)
b65644013ac is described below

commit b65644013aca5fb8dd7c532ce7f8ca835bbef910
Author: Peng Lu <[email protected]>
AuthorDate: Mon Jul 13 23:59:36 2026 +0800

    HBASE-30284 FNFE when viewing MOB Files of a MOB table restored from 
snapshot in HBase UI (#8466)
    
    Signed-off-by: Xiao Liu <[email protected]>
---
 .../hbase-webapps/regionserver/region.jsp          | 32 ++++++++++++++++++----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git 
a/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp 
b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
index a251d335b79..280d77d2a6c 100644
--- a/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
@@ -22,9 +22,11 @@
   import="java.util.Collection"
   import="java.util.Date"
   import="java.util.List"
+  import="java.util.Map"
   import="org.apache.hadoop.fs.FileSystem"
   import="org.apache.hadoop.fs.FileStatus"
   import="org.apache.hadoop.fs.Path"
+  import="org.apache.hadoop.hbase.TableName"
   import="org.apache.hadoop.hbase.client.RegionInfo"
   import="org.apache.hadoop.hbase.client.RegionInfoDisplay"
   import="org.apache.hadoop.hbase.mob.MobUtils"
@@ -33,6 +35,7 @@
   import="org.apache.hadoop.hbase.regionserver.HStoreFile"
   import="org.apache.hadoop.hbase.regionserver.HRegion"
   import="org.apache.hadoop.hbase.regionserver.HStore"
+  import="org.apache.hadoop.hbase.util.CommonFSUtils"
 %>
 <%@ page import="java.nio.charset.StandardCharsets" %>
 <%
@@ -116,6 +119,7 @@
 
          <%
          int mobCnt = 0;
+         HMobStore mobStore = (HMobStore) store;
          for (HStoreFile sf : storeFiles) {
            try {
              byte[] value = sf.getMetadataValue(HStoreFile.MOB_FILE_REFS);
@@ -123,12 +127,30 @@
                continue;
              }
 
-             Collection<String> fileNames = 
MobUtils.deserializeMobFileRefs(value).build().values();
-             for (String fileName : fileNames) {
-               Path mobPath = new Path(((HMobStore) store).getPath(), 
fileName);
-               if (isReplicaRegion && !fs.exists(mobPath)) continue;
+             for (Map.Entry<TableName, String> mobRef :
+               MobUtils.deserializeMobFileRefs(value).build().entries()) {
+               TableName mobTable = mobRef.getKey();
+               String fileName = mobRef.getValue();
+               Path mobPath = null;
+               FileStatus status = null;
+               for (Path candidate : mobStore.getLocations(mobTable)) {
+                 Path p = new Path(candidate, fileName);
+                 FileStatus[] fileStatuses = CommonFSUtils.listStatus(fs, p);
+                 if (fileStatuses == null) {
+                   continue;
+                 }
+                 mobPath = p;
+                 status = fileStatuses[0];
+                 break;
+               }
+
+               if (mobPath == null) {
+                 // File not found in any known location (working dir or 
archive dir) for the referenced table.
+                 // Nothing to show on the UI, so skip it.
+                 continue;
+               }
+
                mobCnt ++;
-               FileStatus status = rs.getFileSystem().getFileStatus(mobPath);
                String mobPathStr = mobPath.toString();
                String encodedStr = URLEncoder.encode(mobPathStr, 
StandardCharsets.UTF_8); %>
 

Reply via email to