What is CreatePartitions?
Increases a topic's partition count via kafka-topics.sh --alter --partitions. Partition count can only go up, never down. Adding partitions breaks message ordering for keys previously co-located on the same partition (key-based producers must rehash), so coordinate carefully.
| Version | Kafka | Changes |
|---|---|---|
| CreatePartitionsRequest | ||
| v0 | 2.2 | + Topics []CreatePartitionsTopic+ Name string+ Count int32+ Assignments []CreatePartitionsAssignment+ BrokerIds []int32+ TimeoutMs int32+ ValidateOnly bool |
| v1 | 2.2 | is the same as version 0. |
| v2 | 2.5 | ~ Flexible encoding enabled FLEXIBLE adds flexible version support |
| v3 | 2.7 | is identical to version 2 but may return a THROTTLING_QUOTA_EXCEEDED error in the response if the partitions creation is throttled (KIP-599). |
| CreatePartitionsResponse | ||
| v0 | 2.2 | + ThrottleTimeMs int32+ Results []CreatePartitionsTopicResult+ Name string+ ErrorCode int16+ ErrorMessage string |
| v1 | 2.2 | on quota violation, brokers send out responses before throttling. |
| v2 | 2.5 | ~ Flexible encoding enabled FLEXIBLE adds flexible version support |
| v3 | 2.7 | is identical to version 2 but may return a THROTTLING_QUOTA_EXCEEDED error in the response if the partitions creation is throttled (KIP-599). |