You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Zheng Hu (JIRA)" <ji...@apache.org> on 2017/07/31 07:37:00 UTC
[jira] [Created] (HBASE-18484) VerifyRep by snapshot does not work
when Yarn / SourceHBase / PeerHBase located in three different cluster
Zheng Hu created HBASE-18484:
--------------------------------
Summary: VerifyRep by snapshot does not work when Yarn / SourceHBase / PeerHBase located in three different cluster
Key: HBASE-18484
URL: https://issues.apache.org/jira/browse/HBASE-18484
Project: HBase
Issue Type: Bug
Components: Replication
Affects Versions: 2.0.0-alpha-1
Reporter: Zheng Hu
Assignee: Zheng Hu
As HBASE-16466 commented.
Seems like that when source hbase cluster / peer hbase cluster / yarn cluster locate in three different HDFS cluster , it has one problem.
when restoring the snapshot into tmpdir , we need to create region by following code (HRegion#createHRegion)
{code}
public static HRegion createHRegion(final HRegionInfo info, final Path rootDir,
final Configuration conf, final TableDescriptor hTableDescriptor,
final WAL wal, final boolean initialize)
throws IOException {
LOG.info("creating HRegion " + info.getTable().getNameAsString()
+ " HTD == " + hTableDescriptor + " RootDir = " + rootDir +
" Table name == " + info.getTable().getNameAsString());
FileSystem fs = FileSystem.get(conf); <------------------- Here our code use fs.defaultFs configuration to create region.
Path tableDir = FSUtils.getTableDir(rootDir, info.getTable());
HRegionFileSystem.createRegionOnFileSystem(conf, fs, tableDir, info);
HRegion region = HRegion.newHRegion(tableDir, wal, fs, conf, info, hTableDescriptor, null);
if (initialize) region.initialize(null);
return region;
}
{code}
When source cluster & peer cluster locate in two difference file systems , then their fs.defaultFs should be difference, so at least one cluster will fail when restore snapshot into tmpdir . after I added the following fix, it works fine for me.
{code}
-FileSystem fs = FileSystem.get(conf);
+FileSystem fs = rootDir.getFileSystem(conf);
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)