Skip to content
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

Merged
merged 9 commits into from Mar 16, 2023

Conversation

CalvinConfluent
Copy link
Contributor

As the first part of the KIP-903, it updates the FetchRequest:

  • Deprecate the ReplicaId field
  • Create a new tagged field ReplicaState with ReplicaId and ReplicaEpoch
  • Bump the FetchRequest version to 15
  • Bump metadata version to 3.5-IV1

https://issues.apache.org/jira/browse/KAFKA-14617

@dajac dajac changed the title Add ReplicaState to FetchRequest. KAFKA-14617; Add ReplicaState to FetchRequest. Mar 2, 2023
@dajac dajac self-requested a review March 2, 2023 10:04
Copy link
Contributor

@dajac dajac left a 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.

@CalvinConfluent
Copy link
Contributor Author

CalvinConfluent commented Mar 2, 2023

@dajac I think the major question is how the KafkaRaftClient can correctly consume the FetchRequest.
The current PR makes quite some efforts to get the FetchRequest apiVersion and then parse the FetchRequest.
If this way is too much trouble, I can think of another one:

  1. Change the FetchRequest old ReplicaId default value to -1.
  2. Then when the KafkaRaftClient receives the request, it can tell the ReplicaId by comparing the value of the old ReplicaId field and the new one(it has default value -1).

@dajac
Copy link
Contributor

dajac commented Mar 2, 2023

@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.

@CalvinConfluent CalvinConfluent changed the title KAFKA-14617; Add ReplicaState to FetchRequest. KAFKA-14617 Add ReplicaState to FetchRequest. Mar 7, 2023
@CalvinConfluent CalvinConfluent force-pushed the calvin.kafka-14617-1 branch 2 times, most recently from 8283907 to ad2f187 Compare March 7, 2023 23:30
@CalvinConfluent
Copy link
Contributor Author

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.

Copy link
Contributor

@dajac dajac left a 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.

@dajac
Copy link
Contributor

dajac commented Mar 9, 2023

@CalvinConfluent Could you rebase the PR? There are a few conflicts.

@CalvinConfluent
Copy link
Contributor Author

@dajac Done.

Copy link
Contributor

@dajac dajac left a 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.

@dajac dajac changed the title KAFKA-14617 Add ReplicaState to FetchRequest. KAFKA-14617: Add ReplicaState to FetchRequest. Mar 10, 2023
@dajac dajac changed the title KAFKA-14617: Add ReplicaState to FetchRequest. KAFKA-14617: Add ReplicaState to FetchRequest Mar 10, 2023
@CalvinConfluent CalvinConfluent requested review from Hangleton, dajac and jolshan and removed request for Hangleton, dajac and jolshan March 11, 2023 04:04
Copy link
Contributor

@dajac dajac left a 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.

Copy link
Contributor

@dajac dajac left a 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.

@dajac
Copy link
Contributor

dajac commented Mar 15, 2023

@CalvinConfluent Could you rebase as well?

Copy link
Contributor

@dajac dajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@dajac
Copy link
Contributor

dajac commented Mar 16, 2023

Failed tests are not related to this PR:

[Build / JDK 17 and Scala 2.13 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/view/change-requests/job/PR-13323/16/testReport/junit/kafka.zk/ZkMigrationIntegrationTest/Build___JDK_17_and_Scala_2_13____1__Type_ZK__Name_testDualWrite__MetadataVersion_3_4_IV0__Security_PLAINTEXT/)
[Build / JDK 17 and Scala 2.13 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/view/change-requests/job/PR-13323/16/testReport/junit/kafka.zk/ZkMigrationIntegrationTest/Build___JDK_17_and_Scala_2_13____1__Type_ZK__Name_testDualWrite__MetadataVersion_3_4_IV0__Security_PLAINTEXT_2/)
[Build / JDK 11 and Scala 2.13 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/view/change-requests/job/PR-13323/16/testReport/junit/kafka.zk/ZkMigrationIntegrationTest/Build___JDK_11_and_Scala_2_13____1__Type_ZK__Name_testDualWrite__MetadataVersion_3_4_IV0__Security_PLAINTEXT/)
[Build / JDK 11 and Scala 2.13 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/view/change-requests/job/PR-13323/16/testReport/junit/kafka.zk/ZkMigrationIntegrationTest/Build___JDK_11_and_Scala_2_13____1__Type_ZK__Name_testDualWrite__MetadataVersion_3_4_IV0__Security_PLAINTEXT_2/)
[Build / JDK 8 and Scala 2.12 / kafka.admin.LeaderElectionCommandTest.[3] Type=ZK, Name=testPathToJsonFile, MetadataVersion=3.5-IV1, Security=PLAINTEXT](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/view/change-requests/job/PR-13323/16/testReport/junit/kafka.admin/LeaderElectionCommandTest/Build___JDK_8_and_Scala_2_12____3__Type_ZK__Name_testPathToJsonFile__MetadataVersion_3_5_IV1__Security_PLAINTEXT/)
[Build / JDK 8 and Scala 2.12 / kafka.admin.TopicCommandIntegrationTest.testTopicDeletion(String).quorum=kraft](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/view/change-requests/job/PR-13323/16/testReport/junit/kafka.admin/TopicCommandIntegrationTest/Build___JDK_8_and_Scala_2_12___testTopicDeletion_String__quorum_kraft/)
[Build / JDK 8 and Scala 2.12 / kafka.server.DynamicBrokerReconfigurationTest.testTrustStoreAlter(String).quorum=kraft](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/view/change-requests/job/PR-13323/16/testReport/junit/kafka.server/DynamicBrokerReconfigurationTest/Build___JDK_8_and_Scala_2_12___testTrustStoreAlter_String__quorum_kraft/)
[Build / JDK 8 and Scala 2.12 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/view/change-requests/job/PR-13323/16/testReport/junit/kafka.zk/ZkMigrationIntegrationTest/Build___JDK_8_and_Scala_2_12____1__Type_ZK__Name_testDualWrite__MetadataVersion_3_4_IV0__Security_PLAINTEXT/)
[Build / JDK 8 and Scala 2.12 / kafka.zk.ZkMigrationIntegrationTest.[1] Type=ZK, Name=testDualWrite, MetadataVersion=3.4-IV0, Security=PLAINTEXT](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/view/change-requests/job/PR-13323/16/testReport/junit/kafka.zk/ZkMigrationIntegrationTest/Build___JDK_8_and_Scala_2_12____1__Type_ZK__Name_testDualWrite__MetadataVersion_3_4_IV0__Security_PLAINTEXT_2/)

I am going to merge it to trunk.

@dajac dajac merged commit 79b5f7f into apache:trunk Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants