{"record":{"id":"6336b932062c955e","repo":"apache/hadoop","slug":"no-usable-persistent-memory-is-found","errorCode":null,"errorMessage":"No usable persistent memory is found","messagePattern":"No usable persistent memory is found","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":397,"sourceCode":"      if (!cacheDir.exists() && !cacheDir.mkdir()) {\n        throw new IOException(\"Failed to create \" + cacheDir.getPath());\n      }\n    }\n  }\n\n  public static String getRealPmemDir(String rawPmemDir) {\n    return new File(rawPmemDir, CACHE_DIR).getAbsolutePath();\n  }\n\n  /**\n   * Choose a persistent memory volume based on a specific algorithm.\n   * Currently it is a round-robin policy.\n   *\n   * TODO: Refine volume selection policy by considering storage utilization.\n   */\n  synchronized Byte chooseVolume(long bytesCount) throws IOException {\n    if (count == 0) {\n      throw new IOException(\"No usable persistent memory is found\");\n    }\n    int k = 0;\n    long maxAvailableSpace = 0L;\n    while (k++ != count) {\n      if (nextIndex == count) {\n        nextIndex = 0;\n      }\n      byte index = nextIndex++;\n      long availableBytes = usedBytesCounts.get(index).getAvailableBytes();\n      if (availableBytes >= bytesCount) {\n        return index;\n      }\n      if (availableBytes > maxAvailableSpace) {\n        maxAvailableSpace = availableBytes;\n      }\n    }\n    throw new IOException(\"There is no enough persistent memory space \" +\n        \"for caching. The current max available space is \" +","sourceCodeStart":379,"sourceCodeEnd":415,"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#L379-L415","documentation":"Error \"No usable persistent memory is found\" thrown in apache/hadoop.","triggerScenarios":"Pmem cache initialization completes with no usable persistent memory volume after all configured dirs fail validation.","commonSituations":"See trigger scenarios.","solutions":["Check that all configured pmem volumes initialized successfully; review earlier PmemVolumeManager errors in the log.","Provide valid, mounted pmem devices in dfs.datanode.pmem.cache.dirs and restart the DataNode."],"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-22T20:17:22.307Z"}