{"record":{"id":"05d8586f6537fdfa","repo":"apache/hadoop","slug":"source-and-dest-are-not-under-the-same-snaps","errorCode":null,"errorMessage":"Source {} and dest {} are not under the same snapshot root.","messagePattern":"Source (.+?) and dest (.+?) are not under the same snapshot root\\.","errorType":"exception","errorClass":"SnapshotException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java","lineNumber":913,"sourceCode":"  private static void checkUnderSameSnapshottableRoot(\n      FSDirectory fsd, INodesInPath srcIIP, INodesInPath dstIIP)\n      throws IOException {\n    // Ensure rename out of a snapshottable root is not permitted if ordered\n    // snapshot deletion feature is enabled\n    SnapshotManager snapshotManager = fsd.getFSNamesystem().\n        getSnapshotManager();\n    if (snapshotManager.isSnapshotDeletionOrdered() && fsd.getFSNamesystem()\n        .isSnapshotTrashRootEnabled()) {\n      INodeDirectory srcRoot = snapshotManager.\n          getSnapshottableAncestorDir(srcIIP);\n      INodeDirectory dstRoot = snapshotManager.\n          getSnapshottableAncestorDir(dstIIP);\n      // Ensure snapshoottable root for both src and dest are same.\n      if (srcRoot != dstRoot) {\n        String errMsg = \"Source \" + srcIIP.getPath() +\n            \" and dest \" + dstIIP.getPath() + \" are not under \" +\n            \"the same snapshot root.\";\n        throw new SnapshotException(errMsg);\n      }\n    }\n  }\n\n  private static RenameResult createRenameResult(FSDirectory fsd,\n      INodesInPath dst, boolean filesDeleted,\n      BlocksMapUpdateInfo collectedBlocks) throws IOException {\n    boolean success = (dst != null);\n    FileStatus auditStat = success ? fsd.getAuditFileInfo(dst) : null;\n    return new RenameResult(\n        success, auditStat, filesDeleted, collectedBlocks);\n  }\n\n  static class RenameResult {\n    final boolean success;\n    final FileStatus auditStat;\n    final boolean filesDeleted;\n    final BlocksMapUpdateInfo collectedBlocks;","sourceCodeStart":895,"sourceCodeEnd":931,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java#L895-L931","documentation":"Error \"Source {} and dest {} are not under the same snapshot root.\" thrown in apache/hadoop.","triggerScenarios":"Renaming a path across snapshot roots: source and destination are not under the same snapshottable directory.","commonSituations":"See trigger scenarios.","solutions":["Rename only within the same snapshottable directory when snapshot operations are involved.","Move the path outside snapshot roots using a full copy instead of rename."],"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"}