{"record":{"id":"f5dddc7ecff76800","repo":"apache/hadoop","slug":"attempted-to-use-qjm-output-buffer-capacity-s","errorCode":null,"errorMessage":"Attempted to use QJM output buffer capacity (\" + size + \") greater than the IPC max data length (ipc.maximum.data.length = \" + ipcMaxDataLength + \"). This will cause journals to reject edits.","messagePattern":"Attempted to use QJM output buffer capacity \\(\" \\+ size \\+ \"\\) greater than the IPC max data length \\(ipc\\.maximum\\.data\\.length = \" \\+ ipcMaxDataLength \\+ \"\\)\\. This will cause journals to reject edits\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java","lineNumber":457,"sourceCode":"        writeTxnsTimeoutMs, layoutVersion);\n  }\n\n  @Override\n  public void finalizeLogSegment(long firstTxId, long lastTxId)\n      throws IOException {\n    QuorumCall<AsyncLogger,Void> q = loggers.finalizeLogSegment(\n        firstTxId, lastTxId);\n    loggers.waitForWriteQuorum(q, finalizeSegmentTimeoutMs,\n        String.format(\"finalizeLogSegment(%s-%s)\", firstTxId, lastTxId));\n  }\n\n  @Override\n  public void setOutputBufferCapacity(int size) {\n    int ipcMaxDataLength = conf.getInt(\n        CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH,\n        CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH_DEFAULT);\n    if (size >= ipcMaxDataLength) {\n      throw new IllegalArgumentException(\"Attempted to use QJM output buffer \"\n          + \"capacity (\" + size + \") greater than the IPC max data length (\"\n          + CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH + \" = \"\n          + ipcMaxDataLength + \"). This will cause journals to reject edits.\");\n    }\n    outputBufferCapacity = size;\n  }\n\n  @Override\n  public void purgeLogsOlderThan(long minTxIdToKeep) throws IOException {\n    // This purges asynchronously -- there's no need to wait for a quorum\n    // here, because it's always OK to fail.\n    LOG.info(\"Purging remote journals older than txid \" + minTxIdToKeep);\n    loggers.purgeLogsOlderThan(minTxIdToKeep);\n  }\n\n  @Override\n  public void recoverUnfinalizedSegments() throws IOException {\n    Preconditions.checkState(!isActiveWriter, \"already active writer\");","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java#L439-L475","documentation":"QuorumJournalManager batches edits into one RPC per write. If the edit-log output buffer capacity were >= ipc.maximum.data.length (default 64MB), a full buffer would exceed the IPC frame limit and JournalNodes would reject the edits RPC. setOutputBufferCapacity() therefore rejects the configuration up front with IllegalArgumentException rather than corrupting edit flow at runtime.","triggerScenarios":"The NameNode edit-log buffer capacity is configured at or above ipc.maximum.data.length — commonly because ipc.maximum.data.length was lowered (IPC DoS hardening) below the edit buffer size, or the edit buffer was raised without raising the IPC limit.","commonSituations":"Security hardening passes that shrink ipc.maximum.data.length; large-edit workloads prompting buffer tuning; drift between NameNode and JournalNode config files.","solutions":["Raise ipc.maximum.data.length on the NameNode and all JournalNodes above the edit-log output buffer capacity.","Alternatively lower the edit output buffer capacity below the IPC limit.","Apply the setting consistently on NN and JNs, restart, and confirm edits flow (check for rejected IPC frames)."],"exampleFix":"<!-- before: buffer >= ipc limit -->\n<property><name>ipc.maximum.data.length</name><value>8388608</value></property>\n\n<!-- after: ipc limit comfortably above edit buffer capacity -->\n<property><name>ipc.maximum.data.length</name><value>67108864</value></property>","handlingStrategy":"validation","validationCode":"// Startup validation: reject configs where edit buffer capacity >= IPC limit\nint bufferCapacity = conf.getInt(\"dfs.namenode.edit.log.output.buffer.capacity...\", /* your edit buffer key */ 0);\nint ipcMax = conf.getInt(\n    CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH,\n    CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH_DEFAULT);\nif (bufferCapacity >= ipcMax) {\n  throw new IllegalArgumentException(\n      \"Edit buffer capacity (\" + bufferCapacity + \") must be < ipc.maximum.data.length (\"\n          + ipcMax + \"); raise ipc.maximum.data.length on NN and JournalNodes\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  qjm.setOutputBufferCapacity(size);\n} catch (IllegalArgumentException e) {\n  // fail fast at config-load time with a clear operator message; fix config, do not catch-and-continue\n  throw new ConfigurationException(\n      \"ipc.maximum.data.length must exceed the edit output buffer capacity; \"\n    + \"set it above \" + size + \" on NameNode and JournalNodes\", e);\n}","preventionTips":["Change ipc.maximum.data.length and edit buffer settings together, cluster-wide, in config management.","Add a config lint step that asserts bufferCapacity < ipc.maximum.data.length before NN start.","After changing either value, restart JournalNodes as well as the NameNode."],"tags":["hdfs","qjm","ipc","configuration","edit-log","message-size"],"backgroundTag":"rpc-message-size-limit-exceeded","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}