Repository: hadoop
Updated Branches:
  refs/heads/branch-2 5004b0571 -> 3b2554f3b


HDFS-10722. Fix race condition in TestEditLog#testBatchedSyncWithClosedLogs. 
Contributed by Daryn Sharp.

(cherry picked from commit 4a8e6dc02fb1d0dc89c3981b444575494511444a)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3b2554f3
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3b2554f3
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3b2554f3

Branch: refs/heads/branch-2
Commit: 3b2554f3b0f686a66e3df20b7c381babb9bc74d3
Parents: 5004b05
Author: Kihwal Lee <kih...@apache.org>
Authored: Thu Aug 4 11:55:31 2016 -0500
Committer: Kihwal Lee <kih...@apache.org>
Committed: Thu Aug 4 11:55:52 2016 -0500

----------------------------------------------------------------------
 .../org/apache/hadoop/hdfs/server/namenode/TestEditLog.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/3b2554f3/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java
index d0bd466..338fc24 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java
@@ -591,9 +591,12 @@ public class TestEditLog {
 
       // Log an edit from thread A
       doLogEdit(threadA, editLog, "thread-a 1");
-      assertEquals("logging edit without syncing should do not affect txid",
-        1, editLog.getSyncTxId());
-
+      // async log is doing batched syncs in background.  logSync just ensures
+      // the edit is durable, so the txid may increase prior to sync
+      if (!useAsyncEditLog) {
+        assertEquals("logging edit without syncing should do not affect txid",
+            1, editLog.getSyncTxId());
+      }
       // logSyncAll in Thread B
       doCallLogSyncAll(threadB, editLog);
       assertEquals("logSyncAll should sync thread A's transaction",


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to