{"record":{"id":"643423a3c764ebf2","repo":"apache/hadoop","slug":"unknown-flag-in-cachepoolinfo","errorCode":null,"errorMessage":"Unknown flag in CachePoolInfo: {}","messagePattern":"Unknown flag in CachePoolInfo: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageSerialization.java","lineNumber":691,"sourceCode":"      info.setOwnerName(readString(in));\n    }\n    if ((flags & 0x2) != 0)  {\n      info.setGroupName(readString(in));\n    }\n    if ((flags & 0x4) != 0) {\n      info.setMode(FsPermission.read(in));\n    }\n    if ((flags & 0x8) != 0) {\n      info.setLimit(readLong(in));\n    }\n    if ((flags & 0x10) != 0) {\n      info.setMaxRelativeExpiryMs(readLong(in));\n    }\n    if ((flags & 0x20) != 0) {\n      info.setDefaultReplication(readShort(in));\n    }\n    if ((flags & ~0x3F) != 0) {\n      throw new IOException(\"Unknown flag in CachePoolInfo: \" + flags);\n    }\n    return info;\n  }\n\n  public static void writeCachePoolInfo(ContentHandler contentHandler,\n      CachePoolInfo info) throws SAXException {\n    XMLUtils.addSaxString(contentHandler, \"POOLNAME\", info.getPoolName());\n\n    final String ownerName = info.getOwnerName();\n    final String groupName = info.getGroupName();\n    final Long limit = info.getLimit();\n    final FsPermission mode = info.getMode();\n    final Long maxRelativeExpiry = info.getMaxRelativeExpiryMs();\n    final Short defaultReplication = info.getDefaultReplication();\n\n    if (ownerName != null) {\n      XMLUtils.addSaxString(contentHandler, \"OWNERNAME\", ownerName);\n    }","sourceCodeStart":673,"sourceCodeEnd":709,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageSerialization.java#L673-L709","documentation":"Cache pools are serialized with a flag word where bits 0x1..0x20 select optional fields (mode, limit, maxRelativeExpiryMs, defaultReplication, etc.). readCachePoolInfo rejects any bit outside the 0x3F mask, meaning the binary/XML was written by a release that defined a flag this build does not know, or the input was crafted/edited incorrectly.","triggerScenarios":"Reading a CachePoolInfo from fsimage/edits/OEV XML with (flags & ~0x3F) != 0 — typically edits or an image written by a newer Hadoop release that added a new cache-pool field, replayed on older binaries.","commonSituations":"Downgrade after cache pools gained new fields; loading archived journals with an older tool; hand-crafted cache pool XML.","solutions":["Read the image/edits with the same or newer Hadoop release that wrote them","Do not hand-edit OEV/OIV XML output","Complete any in-flight rolling upgrade so readers are at least as new as the writer","If you only need the content, dump it with the newer version's tooling instead of loading it on old binaries"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before loading, confirm the image/edits layout is not newer than this build\nif (summaryOrEditsLayoutVersion < HdfsServerConstants.NAMENODE_LAYOUT_VERSION) {\n  throw new IOException(\"input written by a newer layout: \"\n      + summaryOrEditsLayoutVersion);\n}","typeGuard":null,"tryCatchPattern":"catch IOException containing 'Unknown flag in CachePoolInfo' — stop and load the input with a matching Hadoop release; do not attempt partial parsing of cache pool records.","preventionTips":["Pin the Hadoop version used to read archived images/edits","Complete rolling upgrades before any downgrade decision","Dump cache pools with the same-version OIV instead of parsing raw records"],"tags":["hadoop","hdfs","namenode","cache-pool","serialization","version-mismatch"],"backgroundTag":"file-format-version-mismatch","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}