Table of Contents |
---|
Status
Current state: Under discussionAccepted
Discussion thread: here (not that there is an old discussion thread here)
...
- The proposed changes does not require create any breaking changes to in public interfaces
Proposed Changes
A tested PR of the proposed changes is available here https://github.com/apache/kafka/pull/11478.
- . There are however changes that are done to the semantics of the listener configuration, i.e. the following configuration examples
Code Block |
---|
"PLAINTEXT://127.0.0.1:9092,PLAINTEXT://[::1]:9092"
"PLAINTEXT://[::1]:9093,PLAINTEXT://127.0.0.1:9093"
"PLAINTEXT://127.0.0.1:9094,PLAINTEXT://[::1]:9094,PLAINTEXT://127.0.0.1:9095,PLAINTEXT://[::1]:9095"
"PLAINTEXT://[::1]:9096,PLAINTEXT://127.0.0.1:9096,PLAINTEXT://[::1]:9097,PLAINTEXT://127.0.0.1:9097" |
Are now considered valid which means that Kafka will attempt to start with such configurations rather than short circuiting with an error. Specifically this means if and only if you have 2 listeners on the same port and one is IPv4 and the other is IPv6 then this is considered an accepted listener configuration.
Proposed Changes
In summary the proposed changes involve loosening the validation on listenerListToEndPoints
in kafka.utils.CoreUtils.scala so that duplicates ports are allowed if and only if
- The hosts are valid IP's (i.e. not DNS hostnames)
- There are only 2 hosts that share the same port
- One address is an IPv4 and the other is an IPv6
Apart from some adding some extra information that gets thrown when the validation in listenerListToEndPoints
fails there are no changes outside of this specific case case.
Examples of listener configurations which will pass the validation proposed in this KIP
Code Block |
---|
"PLAINTEXT://127.0.0.1:9092,PLAINTEXT://[::1]:9092"
"PLAINTEXT://[::1]:9093,PLAINTEXT://127.0.0.1:9093"
"PLAINTEXT://127.0.0.1:9094,PLAINTEXT://[::1]:9094,PLAINTEXT://127.0.0.1:9095,PLAINTEXT://[::1]:9095"
"PLAINTEXT://[::1]:9096,PLAINTEXT://127.0.0.1:9096,PLAINTEXT://[::1]:9097,PLAINTEXT://127.0.0.1:9097" |
And here are examples of listener configurations which will fail the validation (i.e. no change in behavior)
Code Block |
---|
"PLAINTEXT://[::1]:9092,PLAINTEXT://[::1]:9092"
"PLAINTEXT://127.0.0.1:9092,PLAINTEXT://127.0.0.1:9092"
"PLAINTEXT://127.0.0.1:9092,PLAINTEXT://127.0.0.1:9092,PLAINTEXT://127.0.0.1:9092"
"PLAINTEXT://127.0.0.1:9092,SSL://127.0.0.1:9092,SASL_PLAINTEXT://127.0.0.1:9092" |
Compatibility, Deprecation, and Migration Plan
...