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' Addendum (#4665)

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
huaxiangsun 2022-08-01 16:42:13 -07:00 committed by Bryan Beaudreault
parent 4742658551
commit 495f11417a
1 changed files with 6 additions and 0 deletions

View File

@ -212,6 +212,12 @@ public final class MasterRegion {
FileSystem walFs, Path walRootDir, WALFactory walFactory, MasterRegionWALRoller walRoller, FileSystem walFs, Path walRootDir, WALFactory walFactory, MasterRegionWALRoller walRoller,
String serverName) throws IOException { String serverName) throws IOException {
Path tableDir = CommonFSUtils.getTableDir(rootDir, td.getTableName()); Path tableDir = CommonFSUtils.getTableDir(rootDir, td.getTableName());
FileStatus[] nonRegionDirs = fs.listStatus(tableDir, p -> p.getName().startsWith("."));
if (nonRegionDirs.length > 0) {
LOG.warn("There are non-region directories under " + tableDir + ", such as "
+ nonRegionDirs[0].getPath() + ", ignored");
}
// on branch-2, the RegionInfo.isEncodedRegionName will returns true for .initializing and // 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 // .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. // raise compatibility concerns, so here we just skip them by our own.