{"record":{"id":"9f44b8d9d154c1c3","repo":"apache/hadoop","slug":"failed-to-map-the-test-file-under-realpmemdir","errorCode":null,"errorMessage":"Failed to map the test file under ${realPmemDir}","messagePattern":"Failed to map the test file under (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/PmemVolumeManager.java","lineNumber":345,"sourceCode":"      throw new IllegalArgumentException(message);\n    }\n\n    File realPmemDir = new File(getRealPmemDir(pmemDir.getPath()));\n    if (!realPmemDir.exists() && !realPmemDir.mkdir()) {\n      throw new IOException(\"Failed to create \" + realPmemDir.getPath());\n    }\n\n    String uuidStr = UUID.randomUUID().toString();\n    String testFilePath = realPmemDir.getPath() + \"/.verify.pmem.\" + uuidStr;\n    byte[] contents = uuidStr.getBytes(StandardCharsets.UTF_8);\n    RandomAccessFile testFile = null;\n    MappedByteBuffer out = null;\n    try {\n      testFile = new RandomAccessFile(testFilePath, \"rw\");\n      out = testFile.getChannel().map(FileChannel.MapMode.READ_WRITE, 0,\n          contents.length);\n      if (out == null) {\n        throw new IOException(\n            \"Failed to map the test file under \" + realPmemDir);\n      }\n      out.put(contents);\n      // Forces to write data to storage device containing the mapped file\n      out.force();\n      return realPmemDir;\n    } catch (IOException e) {\n      throw new IOException(\n          \"Exception while writing data to persistent storage dir: \" +\n              realPmemDir, e);\n    } finally {\n      if (out != null) {\n        out.clear();\n      }\n      if (testFile != null) {\n        IOUtils.closeStream(testFile);\n        NativeIO.POSIX.munmap(out);\n        try {","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/PmemVolumeManager.java#L327-L363","documentation":"Error \"Failed to map the test file under ${realPmemDir}\" thrown in apache/hadoop.","triggerScenarios":"Pmem cache initialization when the test file used to verify pmem mapping cannot be mapped, indicating the device is not DAX-capable or misconfigured.","commonSituations":"See trigger scenarios.","solutions":["Confirm the pmem device supports DAX mapping (ndctl list, mount -o dax) and is not exhausted.","Check available space on the pmem volume; free space or use a larger device."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}