{"record":{"id":"ccb560edb1ebd824","repo":"apache/pulsar","slug":"transactionlogbatchedwritemaxrecords-value-must","errorCode":null,"errorMessage":"'transactionLogBatchedWriteMaxRecords' value must be greater than or equal to 10","messagePattern":"'transactionLogBatchedWriteMaxRecords' value must be greater than or equal to 10","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/validator/TransactionBatchedWriteValidator.java","lineNumber":43,"sourceCode":"    public static void validate(ServiceConfiguration configuration){\n        if (configuration.isTransactionPendingAckBatchedWriteEnabled()){\n            if (configuration.getTransactionPendingAckBatchedWriteMaxRecords() < 10){\n                throw new IllegalArgumentException(\"Configuration field \"\n                        + \"'transactionPendingAckBatchedWriteMaxRecords' value must be greater than or equal to 10\");\n            }\n            if (configuration.getTransactionPendingAckBatchedWriteMaxSize() < 1024 * 128){\n                throw new IllegalArgumentException(\"Configuration field \"\n                        + \"'transactionPendingAckBatchedWriteMaxSize' value must be greater than or equal to 128k\");\n            }\n            if (configuration.getTransactionPendingAckBatchedWriteMaxDelayInMillis() < 1){\n                throw new IllegalArgumentException(\"Configuration field \"\n                        + \"'transactionPendingAckBatchedWriteMaxDelayInMillis' value must be greater than or equal to\"\n                        + \" 1\");\n            }\n        }\n        if (configuration.isTransactionLogBatchedWriteEnabled()){\n            if (configuration.getTransactionLogBatchedWriteMaxRecords() < 10){\n                throw new IllegalArgumentException(\"Configuration field \"\n                        + \"'transactionLogBatchedWriteMaxRecords' value must be greater than or equal to 10\");\n            }\n            if (configuration.getTransactionLogBatchedWriteMaxSize() < 1024 * 128){\n                throw new IllegalArgumentException(\"Configuration field \"\n                        + \"'transactionLogBatchedWriteMaxSize' value must be greater than or equal to 128k\");\n            }\n            if (configuration.getTransactionLogBatchedWriteMaxDelayInMillis() < 1){\n                throw new IllegalArgumentException(\"Configuration field \"\n                        + \"'transactionLogBatchedWriteMaxDelayInMillis' value must be greater than or equal to 1\");\n            }\n        }\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":57,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/validator/TransactionBatchedWriteValidator.java#L25-L57","documentation":"When transactionLogBatchedWriteEnabled=true, the validator requires transactionLogBatchedWriteMaxRecords to be at least 10. Values below 10 would create transaction-log batches too small to be useful, so the broker throws IllegalArgumentException at configuration validation time.","triggerScenarios":"Broker startup/config reload with transactionLogBatchedWriteEnabled=true and transactionLogBatchedWriteMaxRecords < 10 (e.g. set to 1 or 5 to 'reduce batching').","commonSituations":"Tuning attempts that lower max records for lower latency; configs copied from examples with disabled batching then only the enable flag flipped; migration scripts applying conservative values.","solutions":["Set transactionLogBatchedWriteMaxRecords to at least 10 in broker.conf (e.g. 100-500 for typical workloads)","Audit config-generation tooling to clamp the value to >= 10","If small batches are truly desired, disable transactionLogBatchedWriteEnabled instead of lowering the record count below the floor"],"exampleFix":"// before (broker.conf)\ntransactionLogBatchedWriteEnabled=true\ntransactionLogBatchedWriteMaxRecords=5\n// after\ntransactionLogBatchedWriteEnabled=true\ntransactionLogBatchedWriteMaxRecords=100","handlingStrategy":"validation","validationCode":"int maxRecords = config.getTransactionLogBatchedWriteMaxRecords();\nif (config.isTransactionLogBatchedWriteEnabled() && maxRecords < 10) {\n    throw new IllegalArgumentException(\"transactionLogBatchedWriteMaxRecords must be >= 10, got \" + maxRecords);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp generated configs to Math.max(10, value) when batching is enabled","Keep sibling fields (maxSize, maxDelay) validated together","Prefer disabling batching rather than shrinking maxRecords below the floor"],"tags":["configuration","pulsar","transactions","broker-startup"],"backgroundTag":"invalid-config-value","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}