{"record":{"id":"602b7eda07fc19d5","repo":"apache/hadoop","slug":"cache-pool-poolname-already-exists","errorCode":null,"errorMessage":"Cache pool poolName already exists.","messagePattern":"Cache pool poolName already exists\\.","errorType":"exception","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java","lineNumber":826,"sourceCode":"\n  /**\n   * Create a cache pool.\n   * \n   * Only the superuser should be able to call this function.\n   *\n   * @param info    The info for the cache pool to create.\n   * @return        Information about the cache pool we created.\n   */\n  public CachePoolInfo addCachePool(CachePoolInfo info)\n      throws IOException {\n    assert namesystem.hasWriteLock(RwLockMode.FS);\n    CachePool pool;\n    try {\n      CachePoolInfo.validate(info);\n      String poolName = info.getPoolName();\n      pool = cachePools.get(poolName);\n      if (pool != null) {\n        throw new InvalidRequestException(\"Cache pool \" + poolName\n            + \" already exists.\");\n      }\n      pool = CachePool.createFromInfoAndDefaults(info);\n      cachePools.put(pool.getPoolName(), pool);\n    } catch (IOException e) {\n      LOG.info(\"addCachePool of \" + info + \" failed: \", e);\n      throw e;\n    }\n    LOG.info(\"addCachePool of {} successful.\", info);\n    return pool.getInfo(true);\n  }\n\n  /**\n   * Modify a cache pool.\n   * \n   * Only the superuser should be able to call this function.\n   *\n   * @param info","sourceCodeStart":808,"sourceCodeEnd":844,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java#L808-L844","documentation":"Error \"Cache pool poolName already exists.\" thrown in apache/hadoop.","triggerScenarios":"addCachePool with a pool name that already exists.","commonSituations":"See trigger scenarios.","solutions":["Use a different pool name, or modify the existing pool with hdfs cacheadmin -modifyPool."],"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"}