{"record":{"id":"6939fdebc2530817","repo":"apache/hadoop","slug":"reserved-is-a-reserved-path-and-snapshot-is-a-r","errorCode":null,"errorMessage":"/.reserved is a reserved path and .snapshot is a reserved path component in this version of HDFS. Please rollback and delete or rename this path, or upgrade with the -renameReserved [key-value pairs] option to automatically rename these paths during upgrade.","messagePattern":"/\\.reserved is a reserved path and \\.snapshot is a reserved path component in this version of HDFS\\. Please rollback and delete or rename this path, or upgrade with the -renameReserved \\[key-value pairs\\] option to automatically rename these paths during upgrade\\.","errorType":"exception","errorClass":"IllegalReservedPathException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java","lineNumber":1156,"sourceCode":"      FSDirectory.DOT_RESERVED_PATH_PREFIX + \" is a reserved path and \"\n      + HdfsConstants.DOT_SNAPSHOT_DIR + \" is a reserved path component in\"\n      + \" this version of HDFS. Please rollback and delete or rename\"\n      + \" this path, or upgrade with the \"\n      + StartupOption.RENAMERESERVED.getName()\n      + \" [key-value pairs]\"\n      + \" option to automatically rename these paths during upgrade.\";\n\n  /**\n   * Same as {@link #renameReservedPathsOnUpgrade}, but for a single\n   * byte array path component.\n   */\n  private static byte[] renameReservedComponentOnUpgrade(byte[] component,\n      final int layoutVersion) throws IllegalReservedPathException {\n    // If the LV doesn't support snapshots, we're doing an upgrade\n    if (!NameNodeLayoutVersion.supports(Feature.SNAPSHOT, layoutVersion)) {\n      if (Arrays.equals(component, HdfsServerConstants.DOT_SNAPSHOT_DIR_BYTES)) {\n        if (!renameReservedMap.containsKey(HdfsConstants.DOT_SNAPSHOT_DIR)) {\n          throw new IllegalReservedPathException(RESERVED_ERROR_MSG);\n        }\n        component =\n            DFSUtil.string2Bytes(renameReservedMap\n                .get(HdfsConstants.DOT_SNAPSHOT_DIR));\n      }\n    }\n    return component;\n  }\n\n  /**\n   * Same as {@link #renameReservedPathsOnUpgrade}, but for a single\n   * byte array path component.\n   */\n  private static byte[] renameReservedRootComponentOnUpgrade(byte[] component,\n      final int layoutVersion) throws IllegalReservedPathException {\n    // If the LV doesn't support inode IDs, we're doing an upgrade\n    if (!NameNodeLayoutVersion.supports(Feature.ADD_INODE_ID, layoutVersion)) {\n      if (Arrays.equals(component, FSDirectory.DOT_RESERVED)) {","sourceCodeStart":1138,"sourceCodeEnd":1174,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java#L1138-L1174","documentation":"Error \"/.reserved is a reserved path and .snapshot is a reserved path component in this version of HDFS. Please rollback and delete or rename this path, or upgrade with the -renameReserved [key-value pairs] option to automatically rename these paths during upgrade.\" thrown in apache/hadoop.","triggerScenarios":"Upgrading from an old release where the namespace contains '/.reserved' paths or '.snapshot' path components that are now reserved.","commonSituations":"See trigger scenarios.","solutions":["Rollback, rename or delete the reserved path, then upgrade again.","Or restart the upgrade with the -renameReserved <key-value pairs> option to auto-rename reserved paths."],"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"}