New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KAFKA-14617: Add ReplicaState to FetchRequest #13323
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CalvinConfluent Thanks for the PR. I made a quick pass on it and I left a few comments and questions.
storage/src/main/java/org/apache/kafka/storage/internals/log/FetchParams.java
Outdated
Show resolved
Hide resolved
storage/src/main/java/org/apache/kafka/storage/internals/log/FetchParams.java
Outdated
Show resolved
Hide resolved
server-common/src/main/java/org/apache/kafka/server/common/MetadataVersion.java
Outdated
Show resolved
Hide resolved
server-common/src/main/java/org/apache/kafka/server/common/MetadataVersion.java
Outdated
Show resolved
Hide resolved
server-common/src/main/java/org/apache/kafka/server/common/MetadataVersion.java
Outdated
Show resolved
Hide resolved
@dajac I think the major question is how the KafkaRaftClient can correctly consume the FetchRequest.
|
@CalvinConfluent Thanks for the explanation. I agree that we have two options on the table: 1) pass the api version or even the header object; or 2) rely on the default sentinel value to read the correct field. Personally, I lean towards 2) here because it is simpler. It would be great to run this by @hachikuji as the authored this part. |
a304d91
to
6b98e88
Compare
8283907
to
ad2f187
Compare
Changing the old ReplicaId field default value to -1. In this way, we can easily extract the replicaId from the FetchRequest without knowing the API version. Simple and minimal work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CalvinConfluent Thanks for the update. I left a few more comments.
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Outdated
Show resolved
Hide resolved
core/src/test/scala/unit/kafka/server/ReplicaFetcherThreadTest.scala
Outdated
Show resolved
Hide resolved
@CalvinConfluent Could you rebase the PR? There are a few conflicts. |
4de4992
to
81c6ba6
Compare
@dajac Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CalvinConfluent Thanks for the update. I left a few more comments.
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/common/requests/FetchRequestTest.java
Outdated
Show resolved
Hide resolved
core/src/test/scala/kafka/server/RemoteLeaderEndPointTest.scala
Outdated
Show resolved
Hide resolved
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java
Outdated
Show resolved
Hide resolved
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CalvinConfluent Thanks for the update. I left a few more comments.
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Outdated
Show resolved
Hide resolved
core/src/test/scala/kafka/server/RemoteLeaderEndPointTest.scala
Outdated
Show resolved
Hide resolved
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CalvinConfluent Thanks for the update and your patience on this one. I left a few more nits. We should be good to go when they are addressed.
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/common/requests/FetchRequestTest.java
Outdated
Show resolved
Hide resolved
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java
Outdated
Show resolved
Hide resolved
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java
Outdated
Show resolved
Hide resolved
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java
Outdated
Show resolved
Hide resolved
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientTest.java
Outdated
Show resolved
Hide resolved
@CalvinConfluent Could you rebase as well? |
3fe2867
to
ec4689e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Failed tests are not related to this PR:
I am going to merge it to trunk. |
As the first part of the KIP-903, it updates the FetchRequest:
https://issues.apache.org/jira/browse/KAFKA-14617