You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Ayush Saxena (Jira)" <ji...@apache.org> on 2023/05/10 04:47:00 UTC
[jira] [Assigned] (HDFS-16991) Fix testMkdirsRaceWithObserverRead
[ https://issues.apache.org/jira/browse/HDFS-16991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ayush Saxena reassigned HDFS-16991:
-----------------------------------
Assignee: fanluo
> Fix testMkdirsRaceWithObserverRead
> ----------------------------------
>
> Key: HDFS-16991
> URL: https://issues.apache.org/jira/browse/HDFS-16991
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs
> Affects Versions: 3.3.4
> Reporter: fanluo
> Assignee: fanluo
> Priority: Minor
> Labels: pull-request-available
>
> The test case testMkdirsRaceWithObserverRead which in TestObserverNode sometimes failed like this:
> {code:java}
> java.lang.AssertionError: Client #1 lastSeenStateId=-9223372036854775808 activStateId=5
> null at org.junit.Assert.fail(Assert.java:89)
> at org.junit.Assert.assertTrue(Assert.java:42)
> at org.apache.hadoop.hdfs.server.namenode.ha.TestObserverNode.testMkdirsRaceWithObserverRead(TestObserverNode.java:607)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) {code}
> i think the Thread.sleep() should move into the sub threads, like this:
> {code:java}
> public void run() {
> try {
> fs.mkdirs(DIR_PATH);
> Thread.sleep(150); // wait until mkdir is logged
> clientState.lastSeenStateId = HATestUtil.getLastSeenStateId(fs);
> assertSentTo(fs, 0); FileStatus stat = fs.getFileStatus(DIR_PATH);
> assertSentTo(fs, 2);
> assertTrue("Should be a directory", stat.isDirectory());
> } catch (FileNotFoundException ioe) {
> clientState.fnfe = ioe;
> } catch (Exception e) {
> fail("Unexpected exception: " + e);
> }
> } {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org