KAFKA-14129: KRaft must check manual assignments for createTopics are contiguous (#12467)
KRaft should validate that manual assignments given to createTopics are contiguous. In other words, they must start with partition 0, and progress through 1, 2, 3, etc. ZK mode does this, but KRaft mode previously did not. Also fix a null pointer exception when the placement for partition 0 was not specified. Convert over AddPartitionsTest to use KRaft. This PR converts all of the test except for some of the placement logic tests, which will need to be redone for KRaft mode in a future change. Fix null pointer exception in KRaftMetadataCache#getPartitionInfo. Specifically, we should not assume that the partition will be found in the hash map. This is another case where we had "Some(x)" but it should be "Option(x)." Fix a potential null pointer exception in BrokerServer#state. Reviewers: dengziming <dengziming1993@gmail.com>, Jason Gustafson <jason@confluent.io>
显示
- core/src/main/scala/kafka/server/BrokerServer.scala 3 个添加, 2 个删除core/src/main/scala/kafka/server/BrokerServer.scala
- core/src/main/scala/kafka/server/metadata/KRaftMetadataCache.scala 1 个添加, 1 个删除...main/scala/kafka/server/metadata/KRaftMetadataCache.scala
- core/src/test/scala/unit/kafka/admin/AddPartitionsTest.scala 112 个添加, 52 个删除core/src/test/scala/unit/kafka/admin/AddPartitionsTest.scala
- metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java 7 个添加, 1 个删除...rg/apache/kafka/controller/ReplicationControlManager.java
想要评论请 注册 或 登录