You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bb...@apache.org on 2022/12/15 17:05:06 UTC
[hbase] 86/91: 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)
This is an automated email from the ASF dual-hosted git repository.
bbeaudreault pushed a commit to branch hubspot-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
commit 47426585513c2f486562ed21d460b05e68e8d82f
Author: huaxiangsun <hu...@apache.org>
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 <zh...@apache.org>
---
.../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 c9666378b83..aa356e3cd3c 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
@@ -212,9 +212,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);