{"record":{"id":"0b7288233ee7ed0c","repo":"apache/hadoop","slug":"failed-to-gcdeletedsnapshot-from-snapshot-i","errorCode":null,"errorMessage":"Failed to gcDeletedSnapshot {} from {}: snapshot is not marked as deleted","messagePattern":"Failed to gcDeletedSnapshot (.+?) from (.+?): snapshot is not marked as deleted","errorType":"exception","errorClass":"SnapshotException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotManager.java","lineNumber":337,"sourceCode":"      throws IOException {\n    final String path = iip.getPath();\n    final INodeDirectory dir = INodeDirectory.valueOf(iip.getLastINode(), path);\n    if (!dir.isSnapshottable()) {\n      throw new SnapshotException(\n          \"Directory is not a snapshottable directory: \" + path);\n    }\n    return dir;\n  }\n\n  public void assertMarkedAsDeleted(INodesInPath iip, String snapshotName)\n      throws IOException {\n    final INodeDirectory dir = getSnapshottableRoot(iip);\n    final Snapshot.Root snapshotRoot = dir.getDirectorySnapshottableFeature()\n        .getSnapshotByName(dir, snapshotName)\n        .getRoot();\n\n    if (!snapshotRoot.isMarkedAsDeleted()) {\n      throw new SnapshotException(\"Failed to gcDeletedSnapshot \"\n          + snapshotName + \" from \" + dir.getFullPathName()\n          + \": snapshot is not marked as deleted\");\n    }\n  }\n\n  void assertPrior(INodeDirectory dir, String snapshotName, int prior)\n      throws SnapshotException {\n    if (!isSnapshotDeletionOrdered()) {\n      return;\n    }\n    // prior must not exist\n    if (prior != Snapshot.NO_SNAPSHOT_ID) {\n      throw new SnapshotException(\"Failed to removeSnapshot \"\n          + snapshotName + \" from \" + dir.getFullPathName()\n          + \": Unexpected prior (=\" + prior + \") when \"\n          + DFS_NAMENODE_SNAPSHOT_DELETION_ORDERED\n          + \" is \" + isSnapshotDeletionOrdered());\n    }","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotManager.java#L319-L355","documentation":"Error \"Failed to gcDeletedSnapshot {} from {}: snapshot is not marked as deleted\" thrown in apache/hadoop.","triggerScenarios":"Garbage collection is requested for a snapshot that is not marked as deleted.","commonSituations":"Internal snapshot GC running against a snapshot whose deletion did not complete or was reverted.","solutions":["Ensure the snapshot was actually deleted (marked for deletion) before requesting GC of the deleted snapshot."],"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"}