diff --git a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/OpenFileCtx.java b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/OpenFileCtx.java index 8306360e6b..159783598f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/OpenFileCtx.java +++ b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/OpenFileCtx.java @@ -710,7 +710,8 @@ public COMMIT_STATUS checkCommit(DFSClient dfsClient, long commitOffset, LOG.debug("Got commit status: " + ret.name()); } // Do the sync outside the lock - if (ret == COMMIT_STATUS.COMMIT_DO_SYNC) { + if (ret == COMMIT_STATUS.COMMIT_DO_SYNC + || ret == COMMIT_STATUS.COMMIT_FINISHED) { try { // Sync file data and length fos.hsync(EnumSet.of(SyncFlag.UPDATE_LENGTH)); diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index e9ea659605..baee3ef262 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -361,6 +361,9 @@ Release 2.2.1 - UNRELEASED HDFS-5281. COMMIT request should not block. (brandonli) + HDFS-5337. should do hsync for a commit request even there is no pending + writes (brandonli) + Release 2.2.0 - 2013-10-13 INCOMPATIBLE CHANGES