{"record":{"id":"772bbba9bf3cb92e","repo":"apache/hadoop","slug":"maxredper-mapreduce-reduce-input-buffer-percent","errorCode":null,"errorMessage":"{maxRedPer}: mapreduce.reduce.input.buffer.percent must be a float between 0 and 1.0","messagePattern":"(.+?): mapreduce\\.reduce\\.input\\.buffer\\.percent must be a float between 0 and 1\\.0","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/reduce/MergeManagerImpl.java","lineNumber":688,"sourceCode":"      final int vlen = vb.getLength() - vp;\n      value.reset(vb.getData(), vp, vlen);\n      bytesRead += vlen;\n    }\n    public long getPosition() throws IOException {\n      return bytesRead;\n    }\n\n    public void close() throws IOException {\n      kvIter.close();\n    }\n  }\n\n  @VisibleForTesting\n  final long getMaxInMemReduceLimit() {\n    final float maxRedPer =\n        jobConf.getFloat(MRJobConfig.REDUCE_INPUT_BUFFER_PERCENT, 0f);\n    if (maxRedPer > 1.0 || maxRedPer < 0.0) {\n      throw new RuntimeException(maxRedPer + \": \"\n          + MRJobConfig.REDUCE_INPUT_BUFFER_PERCENT\n          + \" must be a float between 0 and 1.0\");\n    }\n    return (long)(memoryLimit * maxRedPer);\n  }\n\n  private RawKeyValueIterator finalMerge(JobConf job, FileSystem fs,\n                                       List<InMemoryMapOutput<K,V>> inMemoryMapOutputs,\n                                       List<CompressAwarePath> onDiskMapOutputs\n                                       ) throws IOException {\n    LOG.info(\"finalMerge called with \" +\n        inMemoryMapOutputs.size() + \" in-memory map-outputs and \" +\n        onDiskMapOutputs.size() + \" on-disk map-outputs\");\n    final long maxInMemReduce = getMaxInMemReduceLimit();\n    // merge config params\n    Class<K> keyClass = (Class<K>)job.getMapOutputKeyClass();\n    Class<V> valueClass = (Class<V>)job.getMapOutputValueClass();\n    boolean keepInputs = job.getKeepFailedTaskFiles();","sourceCodeStart":670,"sourceCodeEnd":706,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/reduce/MergeManagerImpl.java#L670-L706","documentation":"MergeManagerImpl.getMaxInMemReduceLimit() reads mapreduce.reduce.input.buffer.percent — the fraction of the shuffle memory limit used to retain map outputs in memory while reduce() runs (0 disables retention, default 0) — and requires a float within [0.0, 1.0], throwing RuntimeException when the reduce phase starts otherwise.","triggerScenarios":"Job conf contains a value such as '2', '1.5', or '-0.1' for mapreduce.reduce.input.buffer.percent.","commonSituations":"Tuning guides suggesting values above 1 for more aggressive in-memory reduce; copy-paste of a percent instead of a fraction; leaving an experiment value in a shared template.","solutions":["Set mapreduce.reduce.input.buffer.percent to a float between 0.0 and 1.0.","Use 0.0 to disable keeping map outputs in memory during reduce (safest when heap is tight).","Remove the override to use the default of 0."],"exampleFix":"<!-- before -->\n<property><name>mapreduce.reduce.input.buffer.percent</name><value>1.2</value></property>\n<!-- after -->\n<property><name>mapreduce.reduce.input.buffer.percent</name><value>0.0</value></property>","handlingStrategy":"validation","validationCode":"// Validate before job submission\nfloat p = conf.getFloat(\"mapreduce.reduce.input.buffer.percent\", 0f);\nif (p < 0.0f || p > 1.0f) { throw new IllegalArgumentException(\"mapreduce.reduce.input.buffer.percent must be a fraction in [0,1]: \" + p); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the value modest (0 to ~0.5) unless reducer heap is generous.","Use 0.0 when in doubt; spilling during reduce is safe."],"tags":["hadoop","mapreduce","shuffle","config","memory","reduce","validation"],"backgroundTag":"config-validation-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}