apache/hadoop · error · IOException

No more available IDs.

Error message

No more available IDs.

What it means

CacheManager.getNextDirectiveId: the monotonic cache-directive id counter has reached Long.MAX_VALUE-1, so no further directive ids can be handed out without wraparound — the (practically unreachable) exhaustion guard.

Solutions

  1. Remove unused cache directives to free directive IDs, or restart the NameNode to reset the ID counter after cleanup.
Defensive patterns

Strategy: validation

When it happens

Trigger: Cache directive creation when the CacheManager has exhausted its ID space.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/79a24946e50324e5. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java:352

  /**
   * @return Unmodifiable view of the collection of CacheDirectives.
   */
  public Collection<CacheDirective> getCacheDirectives() {
    assert namesystem.hasReadLock(RwLockMode.FS);
    return Collections.unmodifiableCollection(directivesById.values());
  }
  
  @VisibleForTesting
  public GSet<CachedBlock, CachedBlock> getCachedBlocks() {
    assert namesystem.hasReadLock(RwLockMode.BM);
    return cachedBlocks;
  }

  private long getNextDirectiveId() throws IOException {
    assert namesystem.hasWriteLock(RwLockMode.FS);
    if (nextDirectiveId >= Long.MAX_VALUE - 1) {
      throw new IOException("No more available IDs.");
    }
    return nextDirectiveId++;
  }

  // Helper getter / validation methods

  private static void checkWritePermission(FSPermissionChecker pc,
      CachePool pool) throws AccessControlException {
    if ((pc != null)) {
      pc.checkPermission(pool, FsAction.WRITE);
    }
  }

  private static String validatePoolName(CacheDirectiveInfo directive)
      throws InvalidRequestException {
    String pool = directive.getPool();
    if (pool == null) {
      throw new InvalidRequestException("No pool specified.");

View on GitHub (pinned to 2add963021)