{"record":{"id":"f9f46dc2241f6b31","repo":"apache/hadoop","slug":"map-is-negative-please-check","errorCode":null,"errorMessage":"map={} is negative. Please check {}","messagePattern":"map=(.+?) is negative\\. Please check (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterFederationRename.java","lineNumber":273,"sourceCode":"  }\n\n  void countIncrement() {\n    routerRenameCounter.incrementAndGet();\n  }\n\n  void countDecrement() {\n    routerRenameCounter.decrementAndGet();\n  }\n\n  static void checkConfiguration(Configuration conf) throws IOException {\n    int map = conf.getInt(DFS_ROUTER_FEDERATION_RENAME_MAP, -1);\n    int bandwidth = conf.getInt(DFS_ROUTER_FEDERATION_RENAME_BANDWIDTH, -1);\n    long delay = conf.getLong(DFS_ROUTER_FEDERATION_RENAME_DELAY,\n        DFS_ROUTER_FEDERATION_RENAME_DELAY_DEFAULT);\n    int diff = conf.getInt(DFS_ROUTER_FEDERATION_RENAME_DIFF,\n        DFS_ROUTER_FEDERATION_RENAME_DIFF_DEFAULT);\n    if (map < 0) {\n      throw new IOException(\"map=\" + map + \" is negative. Please check \"\n          + DFS_ROUTER_FEDERATION_RENAME_MAP);\n    } else if (bandwidth < 0) {\n      throw new IOException(\n          \"bandwidth=\" + bandwidth + \" is negative. Please check \"\n              + DFS_ROUTER_FEDERATION_RENAME_BANDWIDTH);\n    } else if (delay < 0) {\n      throw new IOException(\"delay=\" + delay + \" is negative. Please check \"\n          + DFS_ROUTER_FEDERATION_RENAME_DELAY);\n    } else if (diff < 0) {\n      throw new IOException(\"diff=\" + diff + \" is negative. Please check \"\n          + DFS_ROUTER_FEDERATION_RENAME_DIFF);\n    }\n  }\n}\n","sourceCodeStart":255,"sourceCodeEnd":288,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterFederationRename.java#L255-L288","documentation":"RouterFederationRename.checkConfiguration validates fed-rename tuning before a job is built. The map count is read with default -1 from dfs.federation.router.federation.rename.map, so if the key is unset or set negative, this IOException is thrown telling you exactly which key to fix. 'map' is the number of distcp mappers the fed rename will request.","triggerScenarios":"A cross-namespace rename reaches buildRouterRenameJob / checkConfiguration while dfs.federation.router.federation.rename.map is absent from the router config or set to a negative value (the code reads conf.getInt(key, -1)).","commonSituations":"Enabling fed rename (option=DISTCP) but forgetting the required map/bandwidth settings; typo'd property name so the default -1 applies; porting an older config where keys were named differently.","solutions":["Set dfs.federation.router.federation.rename.map to a positive integer (e.g. number of distcp mappers like 10) in the router's hdfs-site.xml","Check for typos in the key name - a misspelled key silently falls back to -1","Set the companion keys too: dfs.federation.router.federation.rename.bandwidth (positive), and optionally .delay/.diff","Restart the router so the RPC server re-reads configuration"],"exampleFix":"# before: option enabled but map missing -> defaults to -1\n<property><name>dfs.federation.router.federation.rename.option</name><value>DISTCP</value></property>\n# after\n<property><name>dfs.federation.router.federation.rename.option</name><value>DISTCP</value></property>\n<property><name>dfs.federation.router.federation.rename.map</name><value>10</value></property>\n<property><name>dfs.federation.router.federation.rename.bandwidth</name><value>128</value></property>","handlingStrategy":"validation","validationCode":"// Validate fed rename configuration before first use\nint map = conf.getInt(\"dfs.federation.router.federation.rename.map\", -1);\nif (map < 0) {\n  throw new IllegalStateException(\n      \"dfs.federation.router.federation.rename.map must be set to a positive int when fed rename is enabled\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  routerFedRename.routerFedRename(src, dst, srcLocs, dstLocs);\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"dfs.federation.router.federation.rename.map\")) {\n    // config key named in the message: set it and restart the router\n  }\n  throw e;\n}","preventionTips":["Configure map and bandwidth together whenever rename.option=DISTCP is enabled","Use exact key names from RBFConfigKeys; a typo silently selects the -1 default","Add a startup config lint (all fed-rename numerics >= 0) to router deployment tooling"],"tags":["hdfs","router","federation","rename","configuration","misconfiguration"],"backgroundTag":"invalid-configuration-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}