Addendum of HDFS-10722 to include HDFS-7964 logic.

(cherry picked from commit 4a8e6dc02f)
(cherry picked from commit 3b2554f3b0)
(cherry picked from commit c2bb9bf00c)
This commit is contained in:
Kihwal Lee 2016-08-04 11:55:31 -05:00 committed by Zhe Zhang
parent 7900b1e803
commit 91640a0170
1 changed files with 6 additions and 2 deletions

View File

@ -591,8 +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",