hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sunjingtao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-11191) HBase ClusterId File Empty Check Loggic
Date Sun, 18 May 2014 01:42:15 GMT

    [ https://issues.apache.org/jira/browse/HBASE-11191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14000945#comment-14000945
] 

sunjingtao commented on HBASE-11191:
------------------------------------

Yes,same as HBASE-11192! I don't konw why there is two ,maybe i had
submitted twice because of some network problems.About this issue,i think
we should change the following code in the checkClusterIdExists method,not
only check the file whether exists or not ,but also check whether this file
contains a valid clusterId:


*Path filePath = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME);return
fs.exists(filePath);*


Because in my opinion,the following code's purpose is just to  make sure
the master shouldn't fail to start due to the clusterId not exists
problem,but it has not achieve this target:


*if (!FSUtils.checkClusterIdExists(fs, rd, c.getInt(*

*HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000)))*

*{ FSUtils.setClusterId(fs, rd, UUID.randomUUID().toString(), c.getInt(
HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000)); }*









On Sun, May 18, 2014 at 1:07 AM, Jean-Marc Spaggiari (JIRA) <jira@apache.org



> HBase ClusterId File Empty Check Loggic
> ---------------------------------------
>
>                 Key: HBASE-11191
>                 URL: https://issues.apache.org/jira/browse/HBASE-11191
>             Project: HBase
>          Issue Type: Bug
>         Environment: HBase 0.94+Hadoop2.2.0+Zookeeper3.4.5
>            Reporter: sunjingtao
>
> if the clusterid file exists but empty ,then the following check logic in the MasterFileSystem.java
has none effects.
>     if (!FSUtils.checkClusterIdExists(fs, rd, c.getInt(
>         HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000))) {
>           FSUtils.setClusterId(fs, rd, UUID.randomUUID().toString(), c.getInt(
>           HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000));
>     }
>     clusterId = FSUtils.getClusterId(fs, rd);
> because the checkClusterIdExists method only check the path .
>         Path filePath = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME);
>         return fs.exists(filePath);
> in my case ,the file exists but is empty,so the readed clusterid is null which cause
a nullPointerException:
> java.lang.NullPointerException
> 	at org.apache.hadoop.hbase.util.Bytes.toBytes(Bytes.java:441)
> 	at org.apache.hadoop.hbase.zookeeper.ClusterId.setClusterId(ClusterId.java:72)
> 	at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.java:581)
> 	at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:433)
> 	at java.lang.Thread.run(Thread.java:745)
> is this a bug?please make sure!



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message