Commit Graph

663 Commits

Author SHA1 Message Date
Sushant Mahajan 1621f88f06
KAFKA-17367: Share coordinator infra classes [1/N] (#16921)
Introduce ShareCoordinator interface and related classes.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>, David Arthur <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-26 10:09:47 -04:00
xijiu 76fb18f967
KAFKA-17416 Add a checkstyle rule to suppress all generated code (#16998)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-26 17:24:27 +08:00
David Arthur a95dfe215b
MINOR: Move generated sources to build directory (#16993)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-25 14:12:51 +08:00
Greg Harris ad0d8b6c12
MINOR: Clean should delete generated sources (#16839)
Reviewers: Josep Prat <josep.prat@aiven.io>, Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>
2024-08-24 17:16:33 -04:00
Jeff Kim ced34e3176
KAFKA-16379; Coordinator event queue, processing, flush, purgatory time histograms (#16949)
This patch introduces a wrapper around [HdrHistogram](https://github.com/HdrHistogram/HdrHistogram) to use for group coordinator histograms, event queue time, event processing time, flush time, and purgatory time.

Reviewers: David Jacot <djacot@confluent.io>
2024-08-23 04:53:22 -07:00
Apoorv Mittal 3db6e68c4c
KAFKA-17346: Create :share Gradle module (#16888)
Establishes the new `:share` Gradle module. This module is intended to be used for server-side KIP-932 classes that are not part of the new share group coordinator.

This patch relocates and renames some existing classes. A small amount of compatibility changes were also made, but do not affect any logic.

Reviewers: Andrew Schofield <aschofield@confluent.io>, David Arthur <mumrah@gmail.com>
2024-08-19 16:13:08 -04:00
Logan Zhu d28ddcb9f4
KAFKA-17357 Replace the deprecated `retry.maxRetries` / retry.maxFailures` (#16913)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 01:57:24 +08:00
Steven Xu e24354a21d
KAFKA-15203: Use Classgraph since org.reflections is no longer under maintenance (#16604)
Reviewers: Liam Miller-Cushon <cushon@google.com>, Greg Harris <greg.harris@aiven.io>
2024-08-19 10:46:24 -07:00
Sushant Mahajan 4928b549fa
KAFKA-17330: New share-coordinator module. Added record schemas. (#16877)
What
Introduced a new module share-coordinator to house relevant implementation code and resources.
Modified settings.gradle and build.gradle to accommodate the module.
Added ShareSnapshot[Key, Value], ShareUpdate[Key, Value] message record schemas.
Introduced a trivial impl of ShareCoordinatorShard class to establish dependencies with other modules (:coordinator-common, :metadata). The actual impl for this class will be done in future PRs.

Why
The share coordinator component has been introduced as part of KIP-932 (QFK). This component is will be responsible for managing persistence for various data related to share partitions into a dedicated internal topic.
To keep all this functionality contained, we want to create a separate module in line with group and transaction coordinators.


Reviewers:  Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>,  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-08-19 19:24:07 +05:30
Sushant Mahajan c5e9154672
KAFKA-17342 Moved common coordinator code to separate module (#16883)
There is a lot of code in group-coordinator which is not share/consumer/classic group specific.

Since we are introducing a share-coordinator as part of KIP-932 (in a new module), it would make sense to get the common coordinator functionality into a separate common coordinator module so that share-coordinator need not depend on group-coordinator.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, David Jacot <djacot@confluent.io>, Andrew Schofield <aschofield@confluent.io>, Jeff Kim <jeff.kim@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-18 21:48:44 +08:00
José Armando García Sancio 20c3e7324b
KAFKA-16842; Fix config validation and support unknown voters (#16892)
This change fixes the Kafka configuration validation to take into account the reconfiguration changes to configuration and allows KRaft observers to start with an unknown set of voters.

For the Kafka configuration validation the high-level change is that now the user only needs to specify either the controller.quorum.bootstrap.servers property or the controller.quorum.voters property. The other notable change in the configuration is that controller listeners can now be (and should be) specified in advertise.listeners property.

Because Kafka can now be configured without any voters and just the bootstrap servers. The KRaft client needs to allow for an unknown set of voters during the initial startup. This is done by adding the VoterSet#empty set of voters to the KRaftControlRecordStateMachine.

Lastly the RaftClientTestContext type is updated to support this new configuration for KRaft and a test is added to verify that observers can start and send Fetch requests when the voters are unknown.

Reviewers: David Arthur <mumrah@gmail.com>
2024-08-16 15:53:13 -04:00
Colin Patrick McCabe e1b2adea07
KAFKA-17190: AssignmentsManager gets stuck retrying on deleted topics (#16672)
In MetadataVersion 3.7-IV2 and above, the broker's AssignmentsManager sends an RPC to the
controller informing it about which directory we have chosen to place each new replica on.
Unfortunately, the code does not check to see if the topic still exists in the MetadataImage before
sending the RPC. It will also retry infinitely. Therefore, after a topic is created and deleted in
rapid succession, we can get stuck including the now-defunct replica in our subsequent
AssignReplicasToDirsRequests forever.

In order to prevent this problem, the AssignmentsManager should check if a topic still exists (and
is still present on the broker in question) before sending the RPC. In order to prevent log spam,
we should not log any error messages until several minutes have gone past without success.
Finally, rather than creating a new EventQueue event for each assignment request, we should simply
modify a shared data structure and schedule a deferred event to send the accumulated RPCs. This
will improve efficiency.

Reviewers: Igor Soarez <i@soarez.me>, Ron Dagostino <rndgstn@gmail.com>
2024-08-10 12:31:45 +01:00
Colin Patrick McCabe 6a44fb154d
KAFKA-16523; kafka-metadata-quorum: support add-controller and remove-controller (#16774)
This PR adds support for add-controller and remove-controller in the kafka-metadata-quorum.sh
command-line tool. It also fixes some minor server-side bugs that blocked the tool from working.

In kafka-metadata-quorum.sh, the implementation of remove-controller is fairly straightforward. It
just takes some command-line flags and uses them to invoke AdminClient. The add-controller
implementation is a bit more complex because we have to look at the new controller's configuration
file. The parsing logic for the advertised.listeners and listeners server configurations that we
need was previously implemented in the :core module. However, the gradle module where
kafka-metadata-quorum.sh lives, :tools, cannot depend on :core. Therefore, I moved listener parsing
into SocketServerConfigs.listenerListToEndPoints. This will be a small step forward in our efforts
to move Kafka configuration out of :core.

I also made some minor changes in kafka-metadata-quorum.sh and Kafka-storage-tool.sh to handle
--help without displaying a backtrace on the screen, and give slightly better error messages on
stderr. Also, in DynamicVoter.toString, we now enclose the host in brackets if it contains a colon
(as IPV6 addresses can).

This PR fixes our handling of clusterId in addRaftVoter and removeRaftVoter, in two ways. Firstly,
it marks clusterId as nullable in the AddRaftVoterRequest.json and RemoveRaftVoterRequest.json
schemas, as it was always intended to be. Secondly, it allows AdminClient to optionally send
clusterId, by using AddRaftVoterOptions and RemoveRaftVoterOptions. We now also remember to
properly set timeoutMs in AddRaftVoterRequest. This PR adds unit tests for
KafkaAdminClient#addRaftVoter and KafkaAdminClient#removeRaftVoter, to make sure they are sending
the right things.

Finally, I fixed some minor server-side bugs that were blocking the handling of these RPCs.
Firstly, ApiKeys.ADD_RAFT_VOTER and ApiKeys.REMOVE_RAFT_VOTER are now marked as forwardable so that
forwarding from the broker to the active controller works correctly. Secondly,
org.apache.kafka.raft.KafkaNetworkChannel has now been updated to enable API_VERSIONS_REQUEST and
API_VERSIONS_RESPONSE.

Co-authored-by: Murali Basani muralidhar.basani@aiven.io
Reviewers: José Armando García Sancio <jsancio@apache.org>, Alyssa Huang <ahuang@confluent.io>
2024-08-08 15:54:12 -07:00
Kuan-Po Tseng 84add30ea5
KAFKA-16154: Broker returns offset for LATEST_TIERED_TIMESTAMP (#16783)
This pr support EarliestLocalSpec LatestTierSpec in GetOffsetShell, and add integration tests.

Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, PoAn Yang <payang@apache.org>
2024-08-05 10:41:14 +08:00
Ken Huang fa682623b9
KAFKA-16666 Migrate OffsetMessageFormatter to tools module (#16689)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-31 15:18:14 +08:00
Josep Prat e299a006c8
KAFKA-17214: Add 3.8.0 version to streams system tests (#16728)
* KAFKA-17214: Add 3.8.0 version to streams system tests

Reviewers: Bill Bejeck <bbejeck@gmail.com>
2024-07-30 19:04:38 +02:00
Chris Egerton 61f61d6240
KAFKA-14569: Migrate Connect's integration test EmbeddedKafkaCluster from ZK to KRaft mode (#16599)
Reviewers: Omnia Ibrahim <o.g.h.ibrahim@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-29 10:43:55 -04:00
Ken Huang ee03c5f98a
KAFKA-17195 remove generated code path from test scrope of sourceSets (#16688)
The generated code path added to test scope of sourceSets will make `Gradle` assume there are tests in module, and then it results in failed test task since the module does not define test engine.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-25 18:43:46 +08:00
Ken Huang ee68f3215f
KAFKA-16666 Migrate `TransactionLogMessageFormatter` to tools module (#16019)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-25 00:42:25 +08:00
Ken Huang a012af5fb4
KAFKA-17149 Move ProducerStateManagerTest to storage module (#16645)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-23 20:08:08 +08:00
xijiu bc031c0410
KAFKA-17121 junit-platform.properties files in published artifacts pollute the test classpath of consumers (#16624)
Reviewers: Andy Wilkinson <ankinson@mastodon.org.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-19 18:18:27 +08:00
Mickael Maison dceda5e647
MINOR: Don't include checker-qual in distribution (#16578)
Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Satish Duggana <satishd@apache.org>
2024-07-15 17:39:38 +02:00
Xuan-Zhang Gong 0ada8fac68
KAFKA-17096 Fix kafka_log4j_appender.py (#16559)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-12 22:35:55 +08:00
Vincent Rose 43676f7612
MINOR: Generate javadocs on all source files for streams:test-utils (#16556)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-07-09 11:32:16 -07:00
TingIāu "Ting" Kì 07133cebd2
KAFKA-16806 Explicitly declare JUnit dependencies for all test modules (#16301)
Reviewers: Greg Harris <gharris1727@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-06 06:39:11 +08:00
Greg Harris a33cc3d351
KAFKA-17052: Downgrade ShadowJarPlugin to 8.1.3 (#16489)
This version of the ShadowJarPlugin uses the incorrect classifier for the published archive. This is a temporary measure to fix publishing prior to the upcoming release.

Signed-off-by: Greg Harris <greg.harris@aiven.io>


Reviewers:  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-06-29 11:26:39 +05:30
gongxuanzhang 1040d78372
KAFKA-10787 Apply spotless to all module (#16467)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-27 20:50:06 +08:00
Ken Huang 9b4f13efbc
KAFKA-15623 Remove junit 4 from stream module (#16447)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-27 15:11:32 +08:00
TingIāu "Ting" Kì 0e346d3103
KAFKA-15623 (4/N) Migrate streams tests (processor) module to JUnit 5 (#16396)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-24 13:06:35 +08:00
Murali Basani 4194e3d163
MINOR: Rename log4j variables to reload4j (#16324)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Greg Harris <gharris1727@gmail.com>
2024-06-21 10:43:07 +02:00
gongxuanzhang 8d92535382
KAFKA-10787 apply spotless to connect:runtime module (#16412)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-21 16:04:51 +08:00
Nancy 391778b8d7
KAFKA-16803: Change fork, update ShadowJavaPlugin to 8.1.7 (#16295)
Reviewers: Greg Harris <greg.harris@aiven.io>, Divij Vaidya <diviv@amazon.com>
2024-06-20 12:29:57 -07:00
gongxuanzhang 80f31224aa
KAFKA-10787 Apply spotless to `clients` module (#16393)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-20 17:43:25 +08:00
Ken Huang 4de6a90801
KAFKA-16921 [6/N] Remove junit 4 dependency from connect:runtime module (#16383)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-19 14:39:16 +08:00
gongxuanzhang 96989e4b64
KAFKA-10787 Apply spotless to core module (#16392)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-19 14:24:42 +08:00
gongxuanzhang 5a331acad0
KAFKA-10787 apply spotless to `streams:examples` and `streams-scala` (#16378)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-18 18:56:46 +08:00
gongxuanzhang 09b4ef416a
KAFKA-10787 Apply spotless to `stream:test-utils` and `:streams:upgrade-system-tests-xxxx` (#16357)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-17 19:48:44 +08:00
gongxuanzhang 4e846038a6
KAFKA-10787 Apply spotless to `metadata` and `server` and `storage` module (#16297)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-16 05:28:50 +08:00
gongxuanzhang d239dde8f6
KAFKA-10787 Apply spotless to raft module (#16278)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-15 11:28:36 +08:00
Omnia Ibrahim e99da2446c
KAFKA-15853: Move KafkaConfig.configDef out of core (#16116)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-14 17:26:00 +02:00
gongxuanzhang 6d9ef0e12a
KAFKA-10787 Apply spotless to `group-coordinator` and `group-coordinator-api` (#16298)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-14 12:46:28 +08:00
Ken Huang ea60666513
KAFKA-16921 [1/N] Migrate all junit 4 code to junit 5 for connect module (#16253)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-13 16:11:37 +08:00
gongxuanzhang 46eb0814f6
KAFKA-10787 Apply spotless to log4j-appender, trogdor, jmh-benchmarks, examples, shell and generator (#16296)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-12 22:23:39 +08:00
gongxuanzhang 79b9c44acd
KAFKA-10787 Apply spotless to connect module (#16299)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-12 22:19:47 +08:00
gongxuanzhang af86e56fcd
KAFKA-10787 Apply spotless to tools and tools-api module (#16262)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-11 14:48:14 +08:00
Luke Chen 31c55b630b
add slf4jlog4j in tool (#16260)
In #12148 , we removed log4jAppender dependency, and add testImplementation dependency for slf4jlog4j lib. However, we need this runtime dependency in tools module to output logs. (ref) Adding this dependency back.

Note: The slf4jlog4j lib was added in log4j-appender dependency. Since it's removed, we need to explicitly declare it.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Edoardo Comar <ecomar@uk.ibm.com>
2024-06-11 08:43:35 +08:00
gongxuanzhang 816209d187
KAFKA-10787 Apply spotless to transaction-coordinator and server-common (#16172)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-09 05:36:17 +08:00
PoAn Yang 3d5d1504f7
KAFKA-16878 Remove powermock and easymock from code base (#16236)
Reviewers: TaiJuWu <tjwu1217@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-09 00:17:43 +08:00
Ismael Juma e41e54d0a0
MINOR: Remove unnecessary log4j-appender dependency and tweak explicit log4j dependency (#12148)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2024-06-07 16:41:19 +02:00
Johnny Hsu 271a1b42cd
KAFKA-16223 Migrate KafkaConfigBackingStoreTest to Mockito (#16126)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-07 07:02:14 +08:00