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

huaxiangsun 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 aa0fa58d062 HBASE-27251 Rolling back from 2.5.0-SNAPSHOT to 2.4.13 
fails due to 'File does not exist: 
/hbase/MasterData/data/master/store/.initialized/.regioninfo' (#4663)
aa0fa58d062 is described below

commit aa0fa58d062f789cd284ba6d38fc354f08de9e95
Author: huaxiangsun <[email protected]>
AuthorDate: Thu Jul 28 10:42:14 2022 -0700

    HBASE-27251 Rolling back from 2.5.0-SNAPSHOT to 2.4.13 fails due to 'File 
does not exist: /hbase/MasterData/data/master/store/.initialized/.regioninfo' 
(#4663)
    
    Signed-off-by: Duo Zhang <[email protected]>
---
 .../java/org/apache/hadoop/hbase/master/region/MasterRegion.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegion.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegion.java
index 3a31567a64f..daf1e5d1de6 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegion.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegion.java
@@ -225,9 +225,11 @@ public final class MasterRegion {
     FileSystem walFs, Path walRootDir, WALFactory walFactory, 
MasterRegionWALRoller walRoller,
     String serverName) throws IOException {
     Path tableDir = CommonFSUtils.getTableDir(rootDir, td.getTableName());
-    Path regionDir =
-      fs.listStatus(tableDir, p -> 
RegionInfo.isEncodedRegionName(Bytes.toBytes(p.getName())))[0]
-        .getPath();
+    // on branch-2, the RegionInfo.isEncodedRegionName will returns true for 
.initializing and
+    // .initialized, see HBASE-25368. Since RegionInfo is IA.Public, changing 
the implementation may
+    // raise compatibility concerns, so here we just skip them by our own.
+    Path regionDir = fs.listStatus(tableDir, p -> !p.getName().startsWith(".")
+      && 
RegionInfo.isEncodedRegionName(Bytes.toBytes(p.getName())))[0].getPath();
     RegionInfo regionInfo = HRegionFileSystem.loadRegionInfoFileContent(fs, 
regionDir);
 
     Path walRegionDir = FSUtils.getRegionDirFromRootDir(walRootDir, 
regionInfo);

Reply via email to