Skip to content

Commit

Permalink
support KIP-497
Browse files Browse the repository at this point in the history
also notes KIP-595 support in README, since all APIs in KIP-595 are now
defined
  • Loading branch information
twmb committed Sep 25, 2020
1 parent 78faa03 commit aca99bc
Show file tree
Hide file tree
Showing 5 changed files with 563 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ a protocol is supported by code generation.
- [KIP-480](https://cwiki.apache.org/confluence/display/KAFKA/KIP-480%3A+Sticky+Partitioner) (sticky partition producing; 2.4.0)
- [KIP-482](https://cwiki.apache.org/confluence/display/KAFKA/KIP-482%3A+The+Kafka+Protocol+should+Support+Optional+Tagged+Fields) (tagged fields; KAFKA-8885; 2.4.0)
- [KIP-496](https://cwiki.apache.org/confluence/display/KAFKA/KIP-496%3A+Administrative+API+to+delete+consumer+offsets) (offset delete admin command; 2.4.0)
- [KIP-497](https://cwiki.apache.org/confluence/display/KAFKA/KIP-497%3A+Add+inter-broker+API+to+alter+ISR) (new API to alter ISR; 2.7.0)
- [KIP-511](https://cwiki.apache.org/confluence/display/KAFKA/KIP-511%3A+Collect+and+Expose+Client%27s+Name+and+Version+in+the+Brokers) (add client name / version in apiversions req; 2.4.0)
- [KIP-518](https://cwiki.apache.org/confluence/display/KAFKA/KIP-518%3A+Allow+listing+consumer+groups+per+state) (list groups by state; 2.6.0)
- [KIP-525](https://cwiki.apache.org/confluence/display/KAFKA/KIP-525+-+Return+topic+metadata+and+configs+in+CreateTopics+response) (create topics v5 returns configs; 2.4.0)
Expand All @@ -331,4 +332,5 @@ a protocol is supported by code generation.
- [KIP-570](https://cwiki.apache.org/confluence/display/KAFKA/KIP-570%3A+Add+leader+epoch+in+StopReplicaRequest) (leader epoch in stop replica; 2.6.0)
- [KIP-580](https://cwiki.apache.org/confluence/display/KAFKA/KIP-580%3A+Exponential+Backoff+for+Kafka+Clients) (exponential backoff; 2.6.0)
- [KIP-588](https://cwiki.apache.org/confluence/display/KAFKA/KIP-588%3A+Allow+producers+to+recover+gracefully+from+transaction+timeouts) (producer recovery from txn timeout; 2.7.0)
- [KIP-595](https://cwiki.apache.org/confluence/display/KAFKA/KIP-595%3A+A+Raft+Protocol+for+the+Metadata+Quorum) (new APIs for raft protocol; 2.7.0)
- [KIP-599](https://cwiki.apache.org/confluence/display/KAFKA/KIP-599%3A+Throttle+Create+Topic%2C+Create+Partition+and+Delete+Topic+Operations) (throttle create/delete topic/partition; 2.7.0)
38 changes: 38 additions & 0 deletions generate/DEFINITIONS
Original file line number Diff line number Diff line change
Expand Up @@ -3774,3 +3774,41 @@ DescribeQuorumResponse =>
CurrentVoters: [DescribeQuorumResponseTopicPartitionReplicaState]
TargetVoters: [DescribeQuorumResponseTopicPartitionReplicaState]
Observers: [DescribeQuorumResponseTopicPartitionReplicaState]


// AlterISRRequest, proposed in KIP-497 and introduced in Kafka 2.7.0,
// is an admin request to modify ISR.
AlterISRRequest => key 56, max version 0, flexible v0+, admin
// The ID of the requesting broker.
BrokerID: int32
// The epoch of the requesting broker.
BrokerEpoch: int64(-1)
Topics: [=>]
Topic: string
Partitions: [=>]
Partition: int32
// The leader epoch of this partition.
LeaderEpoch: int32
// The ISR for this partition.
NewISR: [int32]
// The expected version of ISR which is being updated.
CurrentISRVersion: int32

AlterISRResponse =>
// ThrottleMillis is how long of a throttle Kafka will apply to the client
// after responding to this request.
ThrottleMillis: int32
ErrorCode: int16
Topics: [=>]
Topic: string
Partitions: [=>]
Partition: int32
ErrorCode: int16
// The broker ID of the leader.
LeaderID: int32
// The leader epoch of this partition.
LeaderEpoch: int32
// The in-sync replica ids.
ISR: [int32]
// The current ISR version.
CurrentISRVersion: int32
2 changes: 2 additions & 0 deletions pkg/kerr/kerr.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ var (
DuplicateResource = &Error{"DUPLICATE_RESOURCE", 92, false, "A request illegally referred to the same resource twice."}
UnacceptableCredential = &Error{"UNACCEPTABLE_CREDENTIAL", 93, false, "Requested credential would not meet criteria for acceptability."}
InconsistentVoterSet = &Error{"INCONSISTENT_VOTER_SET", 94, false, "Indicates that either the sender or recipient of a voter-only request is not one of the expected voters."}
InvalidUpdateVersion = &Error{"INVALID_UPDATE_VERSION", 95, false, "The given update version was invalid."}
)

var code2err = map[int16]error{
Expand Down Expand Up @@ -237,4 +238,5 @@ var code2err = map[int16]error{
92: DuplicateResource,
93: UnacceptableCredential,
94: InconsistentVoterSet,
95: InvalidUpdateVersion,
}
Loading

0 comments on commit aca99bc

Please sign in to comment.