apache/hadoop · error · IOException
Failed to map the test file under ${realPmemDir}
Error message
Failed to map the test file under ${realPmemDir} What it means
Error "Failed to map the test file under ${realPmemDir}" thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/PmemVolumeManager.java:345
throw new IllegalArgumentException(message);
}
File realPmemDir = new File(getRealPmemDir(pmemDir.getPath()));
if (!realPmemDir.exists() && !realPmemDir.mkdir()) {
throw new IOException("Failed to create " + realPmemDir.getPath());
}
String uuidStr = UUID.randomUUID().toString();
String testFilePath = realPmemDir.getPath() + "/.verify.pmem." + uuidStr;
byte[] contents = uuidStr.getBytes(StandardCharsets.UTF_8);
RandomAccessFile testFile = null;
MappedByteBuffer out = null;
try {
testFile = new RandomAccessFile(testFilePath, "rw");
out = testFile.getChannel().map(FileChannel.MapMode.READ_WRITE, 0,
contents.length);
if (out == null) {
throw new IOException(
"Failed to map the test file under " + realPmemDir);
}
out.put(contents);
// Forces to write data to storage device containing the mapped file
out.force();
return realPmemDir;
} catch (IOException e) {
throw new IOException(
"Exception while writing data to persistent storage dir: " +
realPmemDir, e);
} finally {
if (out != null) {
out.clear();
}
if (testFile != null) {
IOUtils.closeStream(testFile);
NativeIO.POSIX.munmap(out);
try {View on GitHub (pinned to 2add963021)
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.
When it happens
Trigger: Pmem cache initialization when the test file used to verify pmem mapping cannot be mapped, indicating the device is not DAX-capable or misconfigured.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/9f44b8d9d154c1c3.
Report an issue: GitHub.