Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
Description
OM Ratis dir creation is attempted from 2 threads:
- Ratis server initializes storage dir in async CompletableFuture
- OM init directly creates it
The latter may encounter the following exception:
java.lang.IllegalArgumentException: Unable to create path: /github/workspace/hadoop-ozone/integration-test/target/test-dir/MiniOzoneClusterImpl-bdc6aaad-da50-4196-ab1e-80aad183d7b2/omNode-2/ratis at org.apache.hadoop.ozone.OmUtils.createOMDir(OmUtils.java:493) at org.apache.hadoop.ozone.om.OzoneManager.<init>(OzoneManager.java:426) at org.apache.hadoop.ozone.om.OzoneManager.createOm(OzoneManager.java:862) at org.apache.hadoop.ozone.MiniOzoneHAClusterImpl$Builder.createOMService(MiniOzoneHAClusterImpl.java:267) at org.apache.hadoop.ozone.MiniOzoneHAClusterImpl$Builder.build(MiniOzoneHAClusterImpl.java:199)
at:
public static File createOMDir(String dirPath) { File dirFile = new File(dirPath); if (!dirFile.exists() && !dirFile.mkdirs()) { throw new IllegalArgumentException("Unable to create path: " + dirFile); } return dirFile; }
It may happen that exists() returns false because the dir is does not exist yet, but mkdirs() also returns false because the dir is created in the meantime by the Ratis thread.
Attachments
Issue Links
- links to