diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt index a0d3c1785b8..19551ba4aca 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt @@ -246,3 +246,5 @@ HDFS-3027. Implement a simple NN health check. (atm) HDFS-3023. Optimize entries in edits log for persistBlocks call. (todd) HDFS-2979. Balancer should use logical uri for creating failover proxy with HA enabled. (atm) + +HDFS-3035. Fix failure of TestFileAppendRestart due to OP_UPDATE_BLOCKS (todd) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileAppendRestart.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileAppendRestart.java index 816332d0a75..e10eab8c57d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileAppendRestart.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileAppendRestart.java @@ -99,27 +99,30 @@ public class TestFileAppendRestart { counts = FSImageTestUtil.countEditLogOpTypes(editLog); // OP_ADD to create file - // OP_ADD for first block + // OP_UPDATE_BLOCKS for first block // OP_CLOSE to close file // OP_ADD to reopen file - // OP_ADD for second block + // OP_UPDATE_BLOCKS for second block // OP_CLOSE to close file - assertEquals(4, (int)counts.get(FSEditLogOpCodes.OP_ADD).held); + assertEquals(2, (int)counts.get(FSEditLogOpCodes.OP_ADD).held); + assertEquals(2, (int)counts.get(FSEditLogOpCodes.OP_UPDATE_BLOCKS).held); assertEquals(2, (int)counts.get(FSEditLogOpCodes.OP_CLOSE).held); Path p2 = new Path("/not-block-boundaries"); writeAndAppend(fs, p2, BLOCK_SIZE/2, BLOCK_SIZE); counts = FSImageTestUtil.countEditLogOpTypes(editLog); // OP_ADD to create file - // OP_ADD for first block + // OP_UPDATE_BLOCKS for first block // OP_CLOSE to close file // OP_ADD to re-establish the lease - // OP_ADD from the updatePipeline call (increments genstamp of last block) - // OP_ADD at the start of the second block + // OP_UPDATE_BLOCKS from the updatePipeline call (increments genstamp of last block) + // OP_UPDATE_BLOCKS at the start of the second block // OP_CLOSE to close file - // Total: 5 OP_ADDs and 2 OP_CLOSEs in addition to the ones above - assertEquals(9, (int)counts.get(FSEditLogOpCodes.OP_ADD).held); - assertEquals(4, (int)counts.get(FSEditLogOpCodes.OP_CLOSE).held); + // Total: 2 OP_ADDs, 3 OP_UPDATE_BLOCKS, and 2 OP_CLOSEs in addition + // to the ones above + assertEquals(2+2, (int)counts.get(FSEditLogOpCodes.OP_ADD).held); + assertEquals(2+3, (int)counts.get(FSEditLogOpCodes.OP_UPDATE_BLOCKS).held); + assertEquals(2+2, (int)counts.get(FSEditLogOpCodes.OP_CLOSE).held); cluster.restartNameNode();