{"record":{"id":"e495dfac6f9041d0","repo":"apache/pulsar","slug":"configuration-field-transactionpendingackbatchedw-e495df","errorCode":null,"errorMessage":"Configuration field 'transactionPendingAckBatchedWriteMaxDelayInMillis' value must be greater than or equal to 1","messagePattern":"Configuration field 'transactionPendingAckBatchedWriteMaxDelayInMillis' value must be greater than or equal to 1","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/validator/TransactionBatchedWriteValidator.java","lineNumber":36,"sourceCode":" */\npackage org.apache.pulsar.broker.validator;\n\nimport org.apache.pulsar.broker.ServiceConfiguration;\n\npublic class TransactionBatchedWriteValidator {\n\n    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        }","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/validator/TransactionBatchedWriteValidator.java#L18-L54","documentation":"The broker validates transaction-related broker.conf fields when batched writes for pending acknowledgments are enabled. If transactionPendingAckBatchedWriteEnabled=true but transactionPendingAckBatchedWriteMaxDelayInMillis is less than 1 (including the 0 default), TransactionBatchedWriteValidator.validate throws IllegalArgumentException during broker startup/configuration load, refusing to start with an invalid config.","triggerScenarios":"Starting or hot-reloading a broker with transactionPendingAckBatchedWriteEnabled=true and transactionPendingAckBatchedWriteMaxDelayInMillis set to 0 or a negative integer (often left at default 0 while only enabling batching and max size).","commonSituations":"Operators enable transaction pending-ack batching but forget the delay is 0 by default; copy-pasted configs omit the delay field; automation templates set delay=0 expecting 'no delay' semantics.","solutions":["Set transactionPendingAckBatchedWriteMaxDelayInMillis=1 or higher in broker.conf (e.g. 1-10 ms is typical)","Ensure the value is an integer >= 1 wherever the config is generated/templated","Only enable transactionPendingAckBatchedWriteEnabled=true after setting all three related fields (maxSize >= 131072, maxDelayInMillis >= 1)","Restart/reload the broker and confirm startup succeeds"],"exampleFix":"// before (broker.conf)\ntransactionPendingAckBatchedWriteEnabled=true\ntransactionPendingAckBatchedWriteMaxSize=131072\ntransactionPendingAckBatchedWriteMaxDelayInMillis=0\n// after\ntransactionPendingAckBatchedWriteEnabled=true\ntransactionPendingAckBatchedWriteMaxSize=131072\ntransactionPendingAckBatchedWriteMaxDelayInMillis=1","handlingStrategy":"validation","validationCode":"int maxDelay = config.getTransactionPendingAckBatchedWriteMaxDelayInMillis();\nif (config.isTransactionPendingAckBatchedWriteEnabled() && maxDelay < 1) {\n    throw new IllegalArgumentException(\"transactionPendingAckBatchedWriteMaxDelayInMillis must be >= 1, got \" + maxDelay);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set maxDelayInMillis together with the enable flag in every config template","Add a config lint/CI check asserting >= 1 for all transaction batched-write fields","Document units (millis) and floor (1) next to the field in deployment tooling"],"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-14T00:17:10.932Z"}