From 68021818558d028f23b2a81503ce6d181a1fc3b0 Mon Sep 17 00:00:00 2001 From: Andrew Kyle Purtell Date: Wed, 30 Dec 2009 00:48:36 +0000 Subject: [PATCH] HBASE-2075 Master requires HDFS superuser privileges due to waitOnSafeMode git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@894525 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../org/apache/hadoop/hbase/util/FSUtils.java | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index c398e1b0564..4714705054b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -141,6 +141,7 @@ Release 0.21.0 - Unreleased at the same time HBASE-2026 NPE in StoreScanner on compaction HBASE-2072 fs.automatic.close isn't passed to FileSystem + HBASE-2075 Master requires HDFS superuser privileges due to waitOnSafeMode IMPROVEMENTS HBASE-1760 Cleanup TODOs in HTable diff --git a/src/java/org/apache/hadoop/hbase/util/FSUtils.java b/src/java/org/apache/hadoop/hbase/util/FSUtils.java index ca14d315126..eb4a277226e 100644 --- a/src/java/org/apache/hadoop/hbase/util/FSUtils.java +++ b/src/java/org/apache/hadoop/hbase/util/FSUtils.java @@ -251,13 +251,18 @@ public class FSUtils { // Are there any data nodes up yet? // Currently the safe mode check falls through if the namenode is up but no // datanodes have reported in yet. - while (dfs.getDataNodeStats().length == 0) { - LOG.info("Waiting for dfs to come up..."); - try { - Thread.sleep(wait); - } catch (InterruptedException e) { - //continue + try { + while (dfs.getDataNodeStats().length == 0) { + LOG.info("Waiting for dfs to come up..."); + try { + Thread.sleep(wait); + } catch (InterruptedException e) { + //continue + } } + } catch (IOException e) { + // getDataNodeStats can fail if superuser privilege is required to run + // the datanode report, just ignore it } // Make sure dfs is not in safe mode while (dfs.setSafeMode(FSConstants.SafeModeAction.SAFEMODE_GET)) {