You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2012/07/25 20:32:31 UTC

svn commit: r1365689 - /hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java

Author: mbautin
Date: Wed Jul 25 18:32:30 2012
New Revision: 1365689

URL: http://svn.apache.org/viewvc?rev=1365689&view=rev
Log:
[master] Fix TestHLog to work correctly with Alligator HDFS.

Author: pritam

Summary:
TetHLog was trying to delete files under /user, which in turn
tried to move the directory to Trash, but since Trash itself is under
/user this operation failed. To fix this I performed the delete by going
to the NN directly.

Another fix is that wal.close() was throwing a RunTimeException that was
not being caught.

Test Plan: Run it

Reviewers: mbautin, hkuang

Reviewed By: mbautin

CC: hdfs-dev@, hbase-eng@

Differential Revision: https://phabricator.fb.com/D528164

Task ID: 1225089

Modified:
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java?rev=1365689&r1=1365688&r2=1365689&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java Wed Jul 25 18:32:30 2012
@@ -84,7 +84,10 @@ public class TestHLog  {
 
     FileStatus[] entries = fs.listStatus(new Path("/"));
     for (FileStatus dir : entries) {
-      fs.delete(dir.getPath(), true);
+      // Go directly to the NN to delete, since fs.delete will try to use
+      // trash and directories like /user cannot be moved to trash.
+      assertTrue(cluster.getNameNode().delete(
+            dir.getPath().toUri().getPath(), true));
     }
 
   }
@@ -350,7 +353,8 @@ public class TestHLog  {
         // wal.writer.close() will throw an exception,
         // but still call this since it closes the LogSyncer thread first
         wal.close();
-      } catch (IOException e) {
+      } catch (Throwable e) {
+        // We can get a RunTimeException here as well.
         LOG.info(e);
       }
       fs.close(); // closing FS last so DFSOutputStream can't call close