You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2012/07/16 20:35:44 UTC

svn commit: r1362180 - in /accumulo/trunk: README server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java

Author: kturner
Date: Mon Jul 16 18:35:43 2012
New Revision: 1362180

URL: http://svn.apache.org/viewvc?rev=1362180&view=rev
Log:
ACCUMULO-623 Made tablet server self destruct if HDFS durable sync is not enabled.

Modified:
    accumulo/trunk/README
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java

Modified: accumulo/trunk/README
URL: http://svn.apache.org/viewvc/accumulo/trunk/README?rev=1362180&r1=1362179&r2=1362180&view=diff
==============================================================================
--- accumulo/trunk/README (original)
+++ accumulo/trunk/README Mon Jul 16 18:35:43 2012
@@ -62,8 +62,12 @@ the machines in the cluster and that had
 found in the same location on every machine in the cluster.  You will need to
 have password-less ssh set up as described in the hadoop documentation. 
 
-You will need to have hadoop installed and configured on your system.
-Accumulo 1.5.0-SNAPSHOT has been tested with hadoop version 0.20.2.
+You will need to have hadoop installed and configured on your system.  Accumulo
+1.5.0-SNAPSHOT has been tested with hadoop version 0.20.2.  To avoid data loss,
+you must enable HDFS durable sync.  How you enable this depends on your version
+of Hadoop.  For older versions of Hadoop set dfs.support.append to true in
+hdfs-site.xml.  For newer versions set dfs.durable.sync to true.  After setting
+these properties restart HDFS.  See ACCUMULO-623 for more information.
 
 The example accumulo configuration files are placed in directories based on the 
 memory footprint for the accumulo processes.  If you are using native libraries

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1362180&r1=1362179&r2=1362180&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java Mon Jul 16 18:35:43 2012
@@ -201,6 +201,7 @@ import org.apache.hadoop.fs.FSDataOutput
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hdfs.DistributedFileSystem;
 import org.apache.hadoop.io.SequenceFile;
 import org.apache.hadoop.io.SequenceFile.Reader;
 import org.apache.hadoop.io.Text;
@@ -3148,6 +3149,7 @@ public class TabletServer extends Abstra
       Instance instance = HdfsZooInstance.getInstance();
       ServerConfiguration conf = new ServerConfiguration(instance);
       Accumulo.init(fs, conf, "tserver");
+      ensureHdfsSyncIsEnabled(fs);
       recoverLocalWriteAheadLogs(fs, conf);
       TabletServer server = new TabletServer(conf, fs);
       server.config(hostname);
@@ -3158,6 +3160,17 @@ public class TabletServer extends Abstra
     }
   }
 
+  private static void ensureHdfsSyncIsEnabled(FileSystem fs) {
+    if (fs instanceof DistributedFileSystem) {
+      if (!fs.getConf().getBoolean("dfs.durable.sync", false) && !fs.getConf().getBoolean("dfs.support.append", false)) {
+        String msg = "Must set dfs.durable.sync OR dfs.support.append to true.  Which one needs to be set depends on your version of HDFS.  See ACCUMULO-623.";
+        log.fatal(msg);
+        System.exit(-1);
+      }
+    }
+    
+  }
+
   /**
    * Copy local walogs into HDFS on an upgrade
    *