apache/hadoop · error · SnapshotException

Failed to gcDeletedSnapshot

Error message

Failed to gcDeletedSnapshot {} from {}: snapshot is not marked as deleted

What it means

GC-timeout diagnostic in SnapshotManager.assertMarkedAsDeleted: the snapshot to garbage-collect is not flagged as deleted in its snapshottable root, i.e. re-encryption GC raced an inconsistent state, and the deletion is refused rather than corrupting the diff.

Solutions

  1. Ensure the snapshot was actually deleted (marked for deletion) before requesting GC of the deleted snapshot.
Defensive patterns

Strategy: validation

When it happens

Trigger: Garbage collection is requested for a snapshot that is not marked as deleted.

Common situations: Internal snapshot GC running against a snapshot whose deletion did not complete or was reverted.


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

Appendix: source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotManager.java:337

      throws IOException {
    final String path = iip.getPath();
    final INodeDirectory dir = INodeDirectory.valueOf(iip.getLastINode(), path);
    if (!dir.isSnapshottable()) {
      throw new SnapshotException(
          "Directory is not a snapshottable directory: " + path);
    }
    return dir;
  }

  public void assertMarkedAsDeleted(INodesInPath iip, String snapshotName)
      throws IOException {
    final INodeDirectory dir = getSnapshottableRoot(iip);
    final Snapshot.Root snapshotRoot = dir.getDirectorySnapshottableFeature()
        .getSnapshotByName(dir, snapshotName)
        .getRoot();

    if (!snapshotRoot.isMarkedAsDeleted()) {
      throw new SnapshotException("Failed to gcDeletedSnapshot "
          + snapshotName + " from " + dir.getFullPathName()
          + ": snapshot is not marked as deleted");
    }
  }

  void assertPrior(INodeDirectory dir, String snapshotName, int prior)
      throws SnapshotException {
    if (!isSnapshotDeletionOrdered()) {
      return;
    }
    // prior must not exist
    if (prior != Snapshot.NO_SNAPSHOT_ID) {
      throw new SnapshotException("Failed to removeSnapshot "
          + snapshotName + " from " + dir.getFullPathName()
          + ": Unexpected prior (=" + prior + ") when "
          + DFS_NAMENODE_SNAPSHOT_DELETION_ORDERED
          + " is " + isSnapshotDeletionOrdered());
    }

View on GitHub (pinned to 2add963021)