{"record":{"id":"a198b7fbe975ccbd","repo":"apache/cassandra","slug":"native-transport-max-message-size-must-not-exceed","errorCode":null,"errorMessage":"native_transport_max_message_size must not exceed native_transport_max_request_data_in_flight","messagePattern":"native_transport_max_message_size must not exceed native_transport_max_request_data_in_flight","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1143,"sourceCode":"        else if (conf.commitlog_segment_size.toMebibytes() >= 2048)\n            throw new ConfigurationException(\"commitlog_segment_size must be smaller than 2048, but was \"\n                                             + conf.commitlog_segment_size.toString(), false);\n\n        if (conf.max_mutation_size == null)\n            conf.max_mutation_size = new DataStorageSpec.IntKibibytesBound(conf.commitlog_segment_size.toKibibytes() / 2);\n        else if (conf.commitlog_segment_size.toKibibytes() < 2 * conf.max_mutation_size.toKibibytes())\n            throw new ConfigurationException(\"commitlog_segment_size must be at least twice the size of max_mutation_size / 1024\", false);\n\n        if (conf.native_transport_max_message_size == null)\n        {\n            conf.native_transport_max_message_size = new DataStorageSpec.LongBytesBound(calculateDefaultNativeTransportMaxMessageSizeInBytes());\n        }\n        else\n        {\n            nativeTransportMaxMessageSizeConfiguredExplicitly = true;\n            long maxCqlMessageSize = conf.native_transport_max_message_size.toBytes();\n            if (maxCqlMessageSize > conf.native_transport_max_request_data_in_flight.toBytes())\n                throw new ConfigurationException(\"native_transport_max_message_size must not exceed native_transport_max_request_data_in_flight\", false);\n\n            if (maxCqlMessageSize > conf.native_transport_max_request_data_in_flight_per_ip.toBytes())\n                throw new ConfigurationException(\"native_transport_max_message_size must not exceed native_transport_max_request_data_in_flight_per_ip\", false);\n\n        }\n        nativeTransportMaxMessageSizeInBytes = conf.native_transport_max_message_size.toBytes();\n\n        // native transport encryption options\n        if (conf.client_encryption_options != null)\n            conf.client_encryption_options.applyConfig();\n\n        if (conf.jmx_server_options == null)\n        {\n            conf.jmx_server_options = JMXServerOptions.createParsingSystemProperties();\n        }\n        else if (JMXServerOptions.isEnabledBySystemProperties())\n        {\n                throw new ConfigurationException(\"Configure either jmx_server_options in cassandra.yaml and comment out \" +","sourceCodeStart":1125,"sourceCodeEnd":1161,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1125-L1161","documentation":"Thrown when native_transport_max_message_size is explicitly configured larger than native_transport_max_request_data_in_flight. The in-flight data limit bounds how many bytes the native protocol can buffer per request, so it must be at least as large as the maximum allowed message size; otherwise valid messages could never complete.","triggerScenarios":"cassandra.yaml sets native_transport_max_message_size (e.g. 256MiB) greater than native_transport_max_request_data_in_flight (e.g. 16MiB). Only checked when the message size was set explicitly (nativeTransportMaxMessageSizeConfiguredExplicitly path).","commonSituations":"Operators raising the CQL message size limit for large batches/inserts but leaving the default in-flight cap; partial copies of a tuned config where only one of the three related options was carried over.","solutions":["Raise native_transport_max_request_data_in_flight to >= native_transport_max_message_size, or","lower native_transport_max_message_size to <= the in-flight limit (also check native_transport_max_request_data_in_flight_per_ip, a similar check follows).","Restart the node."],"exampleFix":"# before\nnative_transport_max_message_size: 256MiB\nnative_transport_max_request_data_in_flight: 16MiB\n# after\nnative_transport_max_message_size: 256MiB\nnative_transport_max_request_data_in_flight: 256MiB","handlingStrategy":"validation","validationCode":"Long msgBytes = parseBytes(yaml.get(\"native_transport_max_message_size\"));\nLong inflightBytes = parseBytes(yaml.get(\"native_transport_max_request_data_in_flight\"));\nif (msgBytes != null && inflightBytes != null && msgBytes > inflightBytes)\n    throw new IllegalArgumentException(\"native_transport_max_message_size must be <= native_transport_max_request_data_in_flight\");","typeGuard":null,"tryCatchPattern":"try {\n    DatabaseDescriptor.applySimpleConfig();\n} catch (ConfigurationException e) {\n    if (e.getMessage().contains(\"native_transport_max_message_size must not exceed\"))\n        logger.error(\"Raise in-flight limit or lower max message size (also check the per-ip limit)\");\n}","preventionTips":["When raising native_transport_max_message_size, raise both in-flight limits in the same change","Leave native_transport_max_message_size unset unless large messages are required","Validate all three related values together in config linting"],"tags":["config","native-protocol"],"backgroundTag":"conflicting-config-options","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}