[ 
https://issues.apache.org/jira/browse/HDFS-10169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15362800#comment-15362800
 ] 

Rakesh R commented on HDFS-10169:
---------------------------------

Hi [~cnauroth], I've come across this failure while analyzing HDFS-10592 QA 
report. Following is my analysis:

In case of {{useAsyncEditLog=true}}, {{FSEditLogAsync#syncThread}} thread is 
running in the background and invoking {{logSync(getLastWrittenTxId());}} call. 
This call will increase the transaction id. In the failed test scenario, the 
next assertion statement is not expecting the logSync() call to happen, but its 
is not deterministic due to async {{logSync()}} call.

{code}
      // 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());
{code}

I think the issue is different from HDFS-10183. Am I missing anything?

Simple way is to skip the test case something similar to 
[TestEditLog_testSyncBatching|https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestEditLog.java#L511]
 approach. But I've tried an attempt to fix this in another way by stopping the 
syncThread and then later restarting it to avoid the async {{logSync()}} call. 
I've attached draft patch to show this approach.

Please review the analysis and the patch. Thanks!

> TestEditLog.testBatchedSyncWithClosedLogs sometimes fails.
> ----------------------------------------------------------
>
>                 Key: HDFS-10169
>                 URL: https://issues.apache.org/jira/browse/HDFS-10169
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Kihwal Lee
>            Assignee: Rakesh R
>         Attachments: HDFS-10169-00.patch
>
>
> This failure has been seen multiple precomit builds recently.
> {noformat}
> testBatchedSyncWithClosedLogs[1](org.apache.hadoop.hdfs.server.namenode.TestEditLog)
>   Time elapsed: 0.377 sec  <<< FAILURE!
> java.lang.AssertionError: logging edit without syncing should do not affect 
> txid expected:<1> but was:<2>
>       at org.junit.Assert.fail(Assert.java:88)
>       at org.junit.Assert.failNotEquals(Assert.java:743)
>       at org.junit.Assert.assertEquals(Assert.java:118)
>       at org.junit.Assert.assertEquals(Assert.java:555)
>       at 
> org.apache.hadoop.hdfs.server.namenode.TestEditLog.testBatchedSyncWithClosedLogs(TestEditLog.java:594)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to