arp7 commented on a change in pull request #1361: URL: https://github.com/apache/hadoop-ozone/pull/1361#discussion_r485332430
########## File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java ########## @@ -209,6 +215,94 @@ public void testObjectStoreCreateWithO3fs() throws Exception { } + + @Test + public void testKeyCreationFailDuetoDirectoryCreationBeforeCommit() + throws Exception { + OzoneVolume ozoneVolume = + cluster.getRpcClient().getObjectStore().getVolume(volumeName); + + OzoneBucket ozoneBucket = ozoneVolume.getBucket(bucketName); + + OzoneOutputStream ozoneOutputStream = + ozoneBucket.createKey("/a/b/c", 10); + byte[] b = new byte[10]; + Arrays.fill(b, (byte)96); + ozoneOutputStream.write(b); + + // Before close create directory with same name. + o3fs.mkdirs(new Path("/a/b/c")); Review comment: Do we have a test case that tests the reverse scenario? i.e. create the dir first, then try to create a file with the same name. Also are we testing this via the object store interface with the flag enabled? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org