Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7069111AFA for ; Fri, 16 May 2014 16:17:56 +0000 (UTC) Received: (qmail 5506 invoked by uid 500); 16 May 2014 11:51:27 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 1904 invoked by uid 500); 16 May 2014 11:40:46 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 42323 invoked by uid 99); 16 May 2014 11:12:41 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 11:12:41 +0000 Date: Fri, 16 May 2014 11:12:41 +0000 (UTC) From: "sunjingtao (JIRA)" To: dev@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HBASE-11192) HBase ClusterId File Empty Check Loggic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 sunjingtao created HBASE-11192: ---------------------------------- Summary: HBase ClusterId File Empty Check Loggic Key: HBASE-11192 URL: https://issues.apache.org/jira/browse/HBASE-11192 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)