diff --git a/CHANGES.txt b/CHANGES.txt index 2ed5adef5f6..8f94734d863 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -131,6 +131,8 @@ Release 0.21.0 - Unreleased HBASE-2048 Small inconsistency in the "Example API Usage" (Benoit Sigoure via JD) HBASE-2044 HBASE-1822 removed not-deprecated APIs + HBASE-1960 Master should wait for DFS to come up when creating + hbase.version 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 0642f0a95fc..ca14d315126 100644 --- a/src/java/org/apache/hadoop/hbase/util/FSUtils.java +++ b/src/java/org/apache/hadoop/hbase/util/FSUtils.java @@ -20,7 +20,6 @@ package org.apache.hadoop.hbase.util; import java.io.DataInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -249,10 +248,20 @@ public class FSUtils { FileSystem fs = FileSystem.get(conf); if (!(fs instanceof DistributedFileSystem)) return; DistributedFileSystem dfs = (DistributedFileSystem)fs; + // 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 + } + } // Make sure dfs is not in safe mode - String message = "Waiting for dfs to exit safe mode..."; while (dfs.setSafeMode(FSConstants.SafeModeAction.SAFEMODE_GET)) { - LOG.info(message); + LOG.info("Waiting for dfs to exit safe mode..."); try { Thread.sleep(wait); } catch (InterruptedException e) {