Commit Graph

783 Commits

Author SHA1 Message Date
TengYao Chi b0b54f6db1
KAFKA-18466 Remove log4j-1.2-api from runtime scope while keeping it in distribution package (#18472)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-12 20:15:10 +08:00
David Jacot 6cc059dced
KAFKA-18304; Introduce json converter generator (#18458)
This patch introduces json converter generator for the coordinator records. It is not used yet but more patches will follow to make us of them.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 08:07:45 +01:00
Colin Patrick McCabe c28d9a3486
KAFKA-18435 Remove zookeeper dependencies in build.gradle (#18450)
Remove Apache ZooKeeper from the Apache Kafka build. Also remove commons IO, commons CLI, and netty, which were dependencies we took only because of ZooKeeper.

In order to keep the size of this PR manageable, I did not remove all classes which formerly interfaced with ZK. I just removed the ZK types. Fortunately, Kafka generally wrapped ZK data structures rather than using them directly.

Some classes were pretty entangled with ZK, so it was easier just to stub them out. For ZkNodeChangeNotificationListener.scala, PartitionStateMachine.scala, ReplicaStateMachine.scala, KafkaZkClient.scala, and ZookeeperClient.scala, I replaced all the functions with "throw new UnsupportedOperationException". Since the tests for these classes have been removed, as well as the ZK-based broker code, this should be OK as an incremental step.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-09 10:25:17 +08:00
David Jacot 7b6e94642a
KAFKA-18303; Update ShareCoordinator to use new record format (#18396)
Following https://github.com/apache/kafka/pull/18261, this patch updates the Share Coordinator to use the new record format.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-01-06 23:59:07 -08:00
Ken Huang bbcc297e37
KAFKA-18358: Replace Deprecated $buildDir variable in build.gradle (#18343)
Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-05 14:18:27 +01:00
TengYao Chi 585b7db482
MINOR: log4j2 upgrade follow-up (#18290)
Reviewers: PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-30 20:38:58 +08:00
Sanskar Jhajharia de7a75a978
MINOR: Fix the failure in streams:testAll (#18303)
Currently, the command ./gradlew :streams:testAll as suggested in README is failing with an error. Following this commit, the command is able to pass and start running the tests in streams suite.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Lucas Brutschy <lbrutschy@confluent.io>
2024-12-23 15:35:08 +01:00
Ismael Juma 2e1134284c
MINOR: Add release note for Java 17 requirement (#18302)
Also remove confusing comment related to connect & Java 17 from build.gradle.
I also updated KIP-1013 to note the implications of KIP-1032.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-22 19:36:03 -08:00
David Jacot d67379c310
KAFKA-18301; Make coordinator records first class citizen (#18261)
This patch is the first one in a series to improve how coordinator records are managed. It focuses on making coordinator records first class citizen in the generator.
* Introduce `coordinator-key` and `coordinator-value` in the schema;
* Introduce `apiKey` for those. This is done to avoid relying on the version to determine the type.
* It also allows the generator to enforce some rules: the key cannot use flexible versions, the key must have a single version `0`, there must be a key and a value for a given api key, etc.
* It generates an enum with all the coordinator record types. This is pretty handy in the code.

The patch also updates the group coordinators to use those.

Reviewers: Jeff Kim <jeff.kim@confluent.io>, Andrew Schofield <aschofield@confluent.io>
2024-12-20 12:16:14 +01:00
Mickael Maison 3fafa096b1
KAFKA-18207: Serde for handling transaction records (#18136)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2024-12-19 21:39:09 +01:00
Ken Huang 5a2b03b200
KAFKA-18235 can't build release tar due to broken genConnectOpenAPIDocs task (#18177)
Reviewers: Christopher L. Shannon <christopher.l.shannon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-15 04:30:54 +08:00
TengYao Chi e41373cef6
KAFKA-18242 The java code in core module is NOT configured with suitable release version (#18182)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-14 17:33:32 +08:00
TengYao Chi b37b89c668
KAFKA-9366 Upgrade log4j to log4j2 (#17373)
This pull request replaces Log4j with Log4j2 across the entire project, including dependencies, configurations, and code. The notable changes are listed below:

1. Introduce Log4j2 Instead of Log4j
2. Change Configuration File Format from Properties to YAML
3. Adds warnings to notify users if they are still using Log4j properties, encouraging them to transition to Log4j2 configurations

Co-authored-by: Lee Dongjin <dongjin@apache.org>

Reviewers: Luke Chen <showuon@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-14 01:14:31 +08:00
Ken Huang 010b9ff6c6
KAFKA-18186 Set `options.release` to make Intellij configure suitable language level automatically (#18104)
Reviewers: "A. Sophie Blee-Goldman" <ableegoldman@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-12 07:39:46 +08:00
Christopher L. Shannon bd6d0fbf3d
KAFKA-16437 Upgrade to Jakarta and Jetty 12 (KIP-1032) (#16754)
This commit implements the changes for KIP-1032. This updates Kafka to Jakarta specs, JavaEE 10 and Jetty 12. The changes here primarily effect Kafka Connect and MM2.

Todo/Notes:

1) I bumped the connect modules to JDK 17 but I also had to bump a couple other things that had a dependency on conect. The tools project depends on connect so that had to be bumped, and streams depends on tools so that needed to be bumped. This means we may need to separate some things if we don't want to enforce JDK 17 on streams.

2) There is an issue with a test in DedicatedMirrorIntegrationTest that I had to change for now that involves escaping characters and not quite sure what to do about it yet. The cause is the Servlet 6 spec changing what is allowed in the path. See: Jetty 12: 400: Ambiguous URI path encoding for path <%=FOO%>~1 (encoded: %3C%25%3DFOO%25%3E%7E1) jetty/jetty.project#11890

3) I had to configure the idle timeout in Jetty requests to match our request timeout so tests didn't fail. This was needed to fix the ConnectWorkerIntegrationTest#testPollTimeoutExpiry() test

Testing is being done by just using the existing tests for Connect and MM2 which should be sufficient.

Reviewers: Greg Harris <greg.harris@aiven.io>, David Arthur <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-11 23:24:14 +08:00
TengYao Chi 408d0f614b
KAFKA-18192 generator module should run under java 11 (#18114)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-10 14:02:34 +08:00
Nick Guo 633cab91c1
KAFKA-18184 Remove the unnecessary project path check from build.gradle (#18102)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-10 13:49:39 +08:00
mingdaoy 4603f7495e
KAFKA-18030 Remove old upgrade-system-tests modules (#17843)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-10 11:19:14 +08:00
snehashisp af0054b502
KAFKA-18182: KIP-891 Add VersionRange to Plugins and DelegatingClassLoader APIs (#16984)
Reviewers: Greg Harris <greg.harris@aiven.io>
2024-12-07 09:20:02 -08:00
TaiJuWu c920989205
MINOR Set min and max heap for Checkstyle (#18071)
This patch sets the max heap for Checkstyle to 1g to avoid OOM during the CI build

Reviewers: David Arthur <mumrah@gmail.com>
2024-12-06 10:40:21 -05:00
David Arthur 82fd763705
MINOR Ensure quarantinedTest always copies test reports (#18068)
The quarantinedTest task will fail (exit 1) if a test was too flaky. Our two Gradle test tasks are run with set +e so we can capture the exit code after the process exits. Prior to this patch, quarantinedTest was not configured with the Gradle ignoreFailures property which meant that it would exit upon failure. This prevented the test XML files from being copied to the "build-xml" directory for later processing.

This patch adds ignoreFailures to quarantinedTest when running on CI.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-05 20:36:15 -05:00
David Jacot c3506834e9
KAFKA-17598; Command line validation tool for RE2J regex (#18031)
This patch introduces the `--validate-regex` argument to the `kafka-consumer-group` command line tool as defined in KIP-848. The new argument allows the verification of RE2 regular expressions.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Lianet Magrans <lmagrans@confluent.io>
2024-12-04 23:40:32 -08:00
TengYao Chi 0e4d8b3e86
KAFKA-17569 Rewrite TestLinearWriteSpeed by Java (#17736)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-26 23:43:01 +08:00
TengYao Chi 056a76e2b9
KAFKA-17811 Separate modules to use different JDKs (#17522)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-26 23:30:41 +08:00
mannoopj be4ea8092b
MINOR: Add git support for schema compatibility checker (#17684)
Add git support for schema compatibility checker. Pulls in valid schema from remote git trunk branch to check with edited schema in local branch. Adds new option for command line verify-evolution-git which takes in a required file name.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2024-11-22 14:02:31 -08:00
Joao Pedro Fonseca Dantas e9ccc2d6f5
KAFKA-16041: Replace Afterburn module with Blackbird (#17884)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2024-11-21 14:52:45 +01:00
David Arthur 5f4cbd4aa4
KAFKA-17767 Automatically quarantine new tests [5/n] (#17725)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-19 09:56:36 +08:00
TengYao Chi 84fe66827d
KAFKA-18006: Add 3.9.0 to end-to-end test (streams) (#17800)
This commit adds AK 3.9 to the system tests on trunk.
Follow-up of #17797

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bruno Cadonna <cadonna@apache.org>
2024-11-15 14:58:24 +01:00
ShivsundarR 6cf4081540
KAFKA-17985: Set share.auto.offset.reset to earliest in ShareRoundTripWorker (#17758)
After the share.auto.offset.reset dynamic config was added for share groups in this commit - 9db5ed0, we needed to update this config value to "earliest" in ShareRoundTripWorker when it creates the consumer.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>
2024-11-12 22:24:28 +05:30
TengYao Chi 393455eb1a
KAFKA-17837 Rewrite DeleteTopicTest (#17579)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-10 03:06:52 +08:00
Bill Bejeck 4ed0a958e5
KAFKA-17248 - KIP 1076 implementation (#17021)
Implementation of KIP-1076 to allow for adding client application metrics to the KIP-714 framework

Reviewers: Apoorv Mittal <amittal@confluent.io>, Andrew Schofield <aschofield@confluent.io>, Matthias Sax <mjsax@apache.org>
2024-11-05 11:29:54 -05:00
Kuan-Po Tseng e3f953483c
KAFKA-17857 Move AbstractResetIntegrationTest and subclasses to tools (#17594)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-05 04:16:19 +08:00
Chia-Chuan Yu fa124385b8
KAFKA-17906 Remove redundant sourceSets from build.gradle (#17672)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-04 23:44:58 +08:00
David Arthur cbf440dfd0
KAFKA-17767 Parse quarantined tests and display them [4/n] (#17661)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-04 23:33:55 +08:00
PoAn Yang 5a3b544d61
KAFKA-17880 Move integration test from streams module to streams/integration-tests module (#17615)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-01 18:21:06 +08:00
Ken Huang 30b1bdfc74
KAFKA-17835 Move ProducerIdManager and RPCProducerIdManager to transaction-coordinator module (#17562)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-31 02:40:47 +08:00
David Jacot af5df59d2b
KAFKA-17593; [1/N] Introduce re2j dependency (#17634)
This patch is the first of a series of patches to introduce support for server side regular expression. It introduces the re2j dependency.

Co-authored-by: Lianet Magrans <lmagrans@confluent.io>

Reviewers: Lianet Magrans <lmagrans@confluent.io>
2024-10-30 08:20:11 -07:00
Sushant Mahajan 5f92f60bff
KAFKA-17329: DefaultStatePersister implementation (#17270)
Adds the DefaultStatePersister and other supporting classes for managing share state.

* Added DefaultStatePersister implementation. This is the entry point for callers who wish to invoke the share state RPC API.
* Added PersisterStateManager which is used by DefaultStatePersister to manage and send the RPCs over the network.
* Added code to BrokerServer and BrokerMetadataPublisher to instantiate the appropriate persister based on the config value for group.share.persister.class.name. If this is not specified, the DefaultStatePersister will be used. To force use of NoOpStatePersister, set the config to empty. This is an internal config, not to be exposed to the end user. This will be used to factory plug the appropriate persister.
* Using this persister, the internal __share_group_state topic will come to life and will be used for persistence of share group info.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Jun Rao <junrao@gmail.com>, David Arthur <mumrah@gmail.com>
2024-10-28 14:11:04 -04:00
Chia-Chuan Yu 7fe009b2e7
KAFKA-17881 Apply the minJavaVersion to test code (#17610)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-27 22:09:54 +08:00
Ken Huang 09d76f917c
KAFKA-16564 Apply `Xlint` to java code in core module (#16965)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-26 01:07:56 +08:00
Dmitry Werner 1eb7644349
KAFKA-16845 Migrate ReplicationQuotasTestRig to new test infra (#17089)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-25 03:33:01 +08:00
TengYao Chi 553e6b4c6d
KAFKA-17860 Remove log4j-appender module (#17588)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-24 18:13:30 +08:00
Manikumar Reddy f55083c9a7
MINOR: Set sourceCompatibility/targetCompatibility properties to Scala Compile task (#17546)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-19 15:31:16 +08:00
Chung, Ming-Yen d9cbbcf69c
KAFKA-17816 Add testRuntimeOnly runtimeTestLibs to test-common-api module (#17523)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-10-18 10:22:13 +08:00
David Arthur ef6c950b88
KAFKA-17767 Extract test catalog from JUnit output [1/n] (#17397)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-17 14:09:22 +08:00
Chia-Chuan Yu 078760a008
KAFKA-17773 Upgrade spotbug to work under java 23 (#17483)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-16 16:48:22 +08:00
Sushant Mahajan 5545d717c3
KAFKA-17633: Add share group record formatter and parser. (#17467)
As part of KIP-932, a new internal topic __share_group_state was introduced. There are 2 types of records which are currently being added in this topic - ShareSnapshotKey/Value and ShareUpdateKey/Value
In light of this, we must make the existing tooling like kafka-console-consumer and kafka-dump-log aware of these records for debugging and introspection purposes.
This PR introduces ShareGroupStateMessageFormatter to be used used with kafka-console-consumer and adds an internal class ShareGroupStateMessageParser in DumpLogSegments.scala.
Unit tests have been added to DumpLogSegmentsTest.scala


Reviewers:  Andrew Schofield <aschofield@confluent.io>,  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-10-15 11:44:15 +05:30
TengYao Chi 582bb48e88
KAFKA-17748 Remove scala-java8-compat (#17497)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-15 13:34:21 +08:00
Chung, Ming-Yen d74f1f847a
KAFKA-17199 Add UT for TransactionLogConfig and TransactionStateManagerConfig (#17442)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-10-12 09:42:54 +08:00
TengYao Chi 9b62c861fa
KAFKA-17739 Clean up build.gradle to adopt the minimum Java version as 11 (#17426)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-10 14:22:38 +08:00
Colin Patrick McCabe 095ab0acba KAFKA-17753: Update protobuf and commons-io dependencies (#17436)
Reviewers: Josep Prat <jlprat@apache.org>
2024-10-09 16:36:56 -07:00
Ken Huang 91390a9726
KAFKA-16896 upgrade spotless version after we drop JDK8 (#17423)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-09 14:10:45 +08:00
David Arthur 51482fa298
MINOR Consolidate junit-platform.properties (#17399)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-08 10:51:33 -04:00
Mickael Maison 5624bc7c7e
MINOR: Remove hamcrest from connect:runtime, raft and server-common (#17394)
Reviewers: David Arthur <mumrah@gmail.com>
2024-10-08 14:22:45 +02:00
TengYao Chi 0e4eebe9c0
KAFKA-12895 Drop support for Scala 2.12 in Kafka 4.0 (#17313)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-07 01:34:38 +08:00
David Arthur d38a90df2b
KAFKA-17672 Run quarantined tests separately (#17329)
Introduce new quarantinedTest that excludes tests tagged with "flaky". Also introduce two new build parameters "maxQuarantineTestRetries" and "maxQuarantineTestRetryFailures".

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-06 14:09:24 +08:00
Chia-Ping Tsai f1d6549679
KAFKA-17706 Allow all imports for test-common and test-common-api (#17378)
Reviewers: David Arthur <mumrah@gmail.com>
2024-10-06 14:02:10 +08:00
Ken Huang 8b5d755bf6
KAFKA-17685 Define common testRuntimeOnly dependencies (#17355)
Reviewers: David Arthur <mumrah@gmail.com>
2024-10-03 15:00:30 -04:00
Chia-Ping Tsai 979740b49d
KAFKA-17589 Move JUnit extensions to test-common module (#17318)
This patch completely removes the compile-time dependency on core for both test and main sources by introducing two new modules.

1) `test-common` include all the common test implementation code (including dependency on :core for BrokerServer, ControllerServer, etc)
2) `test-common:api` new sub-module that just includes interfaces including our junit extension

Reviewers: David Arthur <mumrah@gmail.com>
2024-10-03 10:28:37 +08:00
Omnia Ibrahim 1854d4b8a1
KAFKA-14572: Migrate EmbeddedKafkaCluster used by Streams integration tests from EmbeddedZookeeper to KRaft (#17016)
Migrate the EmbeddedKafkaCluster from the EmbeddedZookeeper to KRaft

Reviewers Bill Bejeck <bbejeck@apache.org>
2024-09-27 15:49:12 -04:00
Dimitar Dimitrov bc47ce1a53
MINOR: Fix a race and add JMH bench for HdrHistogram (#17221) 2024-09-27 23:49:10 +09:00
Apoorv Mittal 05366d2fa7
KAFKA-17626: Move common fetch related classes from storage to server-common (#17289)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>
2024-09-26 20:31:28 -04:00
Apoorv Mittal 6abbd548b8
MINOR Refactoring share fetch code (KIP-932) (#17269)
Reviewers: Andrew Schofield <aschofield@confluent.io>, David Arthur <mumrah@gmail.com>
2024-09-26 08:09:31 -04:00
Sushant Mahajan 67f966f348
KAFKA-17469: Moved share external interfaces to share module. (#17262)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, David Arthur <mumrah@gmail.com>
2024-09-24 12:08:01 -04:00
PoAn Yang 98252cae14
KAFKA-16681 Rewrite MiniKDC by Java (#16213)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-14 04:13:40 +08:00
Sushant Mahajan 821c10157d
KAFKA-17367: Introduce share coordinator [2/N] (#17011)
Introduces the share coordinator. This coordinator is built on the new coordinator runtime framework. It 
is responsible for persistence of share-group state in a new internal topic named "__share_group_state".
The responsibility for being a share coordinator is distributed across the brokers in a cluster. 

Reviewers: David Arthur <mumrah@gmail.com>, Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>
2024-09-09 20:01:24 -04:00
David Arthur 62379d7d53
KAFKA-17479 Fix ignoreFailures logic in CI workflow [3/n] (#17106)
The ignoreFailures property was removed in #17066 to prevent test failures from being cached. However, this breaks the JUnit report and makes the github workflow less user friendly.

The problem is that we are copying the junit test report files into a new directory (added in #17098) in a Gradle doLast closure. If we don't run with ignoreFailures=true, then this closure will not run and the test failures won't be processed by junit.py.

This patch adds logic to ensure the doLast closure of :test is always run. The user provided -PignoreFailures is still honored for the test tasks so local developer workflows should not be disturbed.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-06 14:47:42 -04:00
David Arthur 84aa5d7a63
KAFKA-17479 Relocate junit XML files [2/n] (#17098)
Recently, we fixed caching for ":jar" and ":test" tasks. A side effect of this is that the test results will be restored as part of the Gradle cache resolution. This means test tasks which are skipped (as a result of FROM-CACHE) will still have test results in their build directory. To avoid incorrectly reporting these results in the job summary, this patch uses a doLast task handler to relocate JUnit XML files into a new directory.

This patch also removes the "continue-on-error" from the JUnit test step which caused timed-out builds to appear successful.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-05 13:50:33 -04:00
David Arthur 0294b1402d
KAFKA-17479 Allow ":jar" tasks to be cached [1/n] (#17066)
For several modules, we include a kafka-version.properties in the Jar file. This file includes the Git SHA of the project at the time of the build. This means that even if no source files change, the :jar task will never be UP-TO-DATE between two git commits. Ultimately, this breaks Gradle caching.

This patch marks all of the createVersionFile tasks as cacheable and also changes our Gradle invocation to override the commit ID to a dummy static value. This will allow the :jar task to be cacheable and reusable between builds.

This patch also configures the trunk build to only write to the build cache and not read from it. This will prevent any cache pollution/corruption from propagating from build to build.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-04 15:06:11 -04:00
David Arthur 7005a1fa4b
KAFKA-17433 Add a deflake Github action (#17019)
This patch adds a "deflake" github action which can be used to run a single JUnit test or suites. It works by parameterizing the --tests Gradle option. If the test extends ClusterTest, the "deflake" workflow can repeat number of times by setting the kafka.cluster.test.repeat system property.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-31 11:26:33 +08:00
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