{"record":{"id":"79a24946e50324e5","repo":"apache/hadoop","slug":"no-more-available-ids","errorCode":null,"errorMessage":"No more available IDs.","messagePattern":"No more available IDs\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java","lineNumber":352,"sourceCode":"\n  /**\n   * @return Unmodifiable view of the collection of CacheDirectives.\n   */\n  public Collection<CacheDirective> getCacheDirectives() {\n    assert namesystem.hasReadLock(RwLockMode.FS);\n    return Collections.unmodifiableCollection(directivesById.values());\n  }\n  \n  @VisibleForTesting\n  public GSet<CachedBlock, CachedBlock> getCachedBlocks() {\n    assert namesystem.hasReadLock(RwLockMode.BM);\n    return cachedBlocks;\n  }\n\n  private long getNextDirectiveId() throws IOException {\n    assert namesystem.hasWriteLock(RwLockMode.FS);\n    if (nextDirectiveId >= Long.MAX_VALUE - 1) {\n      throw new IOException(\"No more available IDs.\");\n    }\n    return nextDirectiveId++;\n  }\n\n  // Helper getter / validation methods\n\n  private static void checkWritePermission(FSPermissionChecker pc,\n      CachePool pool) throws AccessControlException {\n    if ((pc != null)) {\n      pc.checkPermission(pool, FsAction.WRITE);\n    }\n  }\n\n  private static String validatePoolName(CacheDirectiveInfo directive)\n      throws InvalidRequestException {\n    String pool = directive.getPool();\n    if (pool == null) {\n      throw new InvalidRequestException(\"No pool specified.\");","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java#L334-L370","documentation":"Error \"No more available IDs.\" thrown in apache/hadoop.","triggerScenarios":"Cache directive creation when the CacheManager has exhausted its ID space.","commonSituations":"See trigger scenarios.","solutions":["Remove unused cache directives to free directive IDs, or restart the NameNode to reset the ID counter after cleanup."],"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"}