HBASE-9497 Old .META. .tableinfo file kills HMaster
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1521736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
49fc546051
commit
d1d7e80c21
|
@ -312,6 +312,9 @@ public class NamespaceUpgrade implements Tool {
|
|||
+ oldMetaRegionDir + " to " + newMetaRegionDir);
|
||||
}
|
||||
}
|
||||
// Remove .tableinfo files as they refer to ".META.".
|
||||
// They will be recreated by master on startup.
|
||||
removeTableInfoInPre96Format(TableName.META_TABLE_NAME);
|
||||
|
||||
Path oldRootDir = new Path(rootDir, "-ROOT-");
|
||||
if(!fs.rename(oldRootDir, backupDir)) {
|
||||
|
@ -319,6 +322,21 @@ public class NamespaceUpgrade implements Tool {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes .tableinfo files that are laid in pre-96 format (i.e., the tableinfo files are under
|
||||
* table directory).
|
||||
* @param tableName
|
||||
* @throws IOException
|
||||
*/
|
||||
private void removeTableInfoInPre96Format(TableName tableName) throws IOException {
|
||||
Path tableDir = FSUtils.getTableDir(rootDir, tableName);
|
||||
FileStatus[] status = FSUtils.listStatus(fs, tableDir, TABLEINFO_PATHFILTER);
|
||||
if (status == null) return;
|
||||
for (FileStatus fStatus : status) {
|
||||
FSUtils.delete(fs, fStatus.getPath(), false);
|
||||
}
|
||||
}
|
||||
|
||||
public void migrateACL() throws IOException {
|
||||
|
||||
TableName oldTableName = TableName.valueOf(OLD_ACL);
|
||||
|
|
Loading…
Reference in New Issue