Commit Graph

13609 Commits

Author SHA1 Message Date
TengYao Chi f745dfdcee
MINOR: Upgrade jetty version (#19680)
When building RC, the current version of Jetty has been reporting for
CVE.
Hence, we should upgrade the Jetty version to fix it.
2025-05-12 11:02:32 +08:00
frankvicky c0b64c2273 Bump version to 3.9.1 2025-05-10 09:05:22 +08:00
Josep Prat a690a3cfa1
MINOR: Fix netty version in LICENSE-binary (#19665)
During PR https://github.com/apache/kafka/pull/19484 only the dependency
was updated but not the `LICENSE-binary` file. This fixes this
misalignment.

Signed-off-by: Josep Prat <josep.prat@aiven.io>

Reviewers: Luke Chen <showuon@gmail.com>
2025-05-09 13:34:33 +02:00
TengYao Chi c0909b0551
MINOR: Bump templateData.js version (#19648)
Bump version to 3.9.1

Reviewers: Luke Chen <showuon@gmail.com>
2025-05-06 17:41:54 +08:00
Edoardo Comar ed900eb96f
KAFKA-19026: add note in ZK to KRaft migration (#19563)
Add a brief note pointing to the issue in the migration guide

Reviewers: Luke Chen <showuon@gmail.com>, TengYao Chi
<frankvicky@apache.org>
2025-04-26 09:54:55 +08:00
frankvicky 141693270b Bump version to 3.9.1 2025-04-22 22:17:50 +08:00
Luke Chen dfa7a0d291
MINOR: Update system test dev version to 3.9.1 (#19534)
Ran system test based on 3.9 branch, but got the error: 
`Did expect to read 'Kafka version.*3.9.1.*SNAPSHOT' from
ducker@ducker04`. It's because the version should be `3.9.1` without
snapshot. Update the version.

Reviewers: TengYao Chi <frankvicky@apache.org>
2025-04-22 20:53:46 +08:00
Luke Chen 1f18da3112 Bump version to 3.9.1 2025-04-22 14:53:18 +08:00
Luke Chen 705d4f2bc6 revert test 2025-04-22 13:58:27 +08:00
Luke Chen d22ceff679 Bump version to 3.9.1 2025-04-22 13:46:44 +08:00
Luke Chen 1962455fd6 test 2025-04-22 13:45:26 +08:00
David Arthur 5681889fba Push the branch with the RC tag merge in 2025-04-22 13:43:28 +08:00
Luke Chen d88c2183ce
MINOR: Upgrade Netty to 4.19 (#19484)
CVE-2025-24970: Netty, an asynchronous, event-driven network application
framework, has a vulnerability starting in version 4.1.91.Final and
prior to version 4.1.118.Final.

Reviewers: TengYao Chi <kitingiao@gmail.com>
2025-04-16 11:45:07 +08:00
frankvicky 9310f4019a Bump year of NOTICE 2025-04-15 20:08:32 +08:00
Azhar Ahmed 1be663ade3 KAFKA-19071: Fix doc for remote.storage.enable (#19345)
As of 3.9, Kafka allows disabling remote storage on a topic after it was
enabled. It allows subsequent enabling and disabling too.

However the documentation says otherwise and needs to be corrected.

Doc:
https://kafka.apache.org/39/documentation/#topicconfigs_remote.storage.enable

Reviewers: Luke Chen <showuon@gmail.com>, PoAn Yang <payang@apache.org>, Ken Huang <s7133700@gmail.com>
2025-04-14 11:10:06 +08:00
Luke Chen 6abe1ff51a
MINOR: Fix kraft ver broken test (#19448)
Fix failed
`kafka.server.KRaftClusterTest."testDescribeKRaftVersion(boolean)` test.
It is failing in [3.9
branch](https://ci-builds.apache.org/job/Kafka/job/kafka/job/3.9/186/#showFailuresLink).

In the [patch for
4.0](https://github.com/apache/kafka/pull/19127/files#diff-a95d286b4e1eb166af89ea45bf1fe14cd8c944d7fc0483bfd4eff2245d1d2bbbR1014),
we created TestKitNodes like this:
```
new TestKitNodes.Builder().
        setNumBrokerNodes(1).
        setNumControllerNodes(1).
        setFeature(KRaftVersion.FEATURE_NAME, 1.toShort).build()).build()
```
But in the 3.9, because we don't have `setFeature` method in
TestKitNodes, we removed it which causes the test failure. Added them
back to 3.9 branch.

Also in 4.0, we include this
[patch](https://github.com/apache/kafka/pull/17582/files#r1823404214),
which contains a bug fix and TestKitNodes improvement to allow set
features. Added them in 3.9 branch to fix the test and the finalized
version always 0 issue.

Reviewers: PoAn Yang <payang@apache.org>, TengYao Chi <kitingiao@gmail.com>
2025-04-12 08:07:07 +08:00
Colin Patrick McCabe 21dd41b251 KAFKA-18920: The kcontrollers must set kraft.version in ApiVersionsResponse (#19127)
The kafka controllers need to set kraft.version in their
ApiVersionsResponse messages according to the current kraft.version
reported by the Raft layer. Instead, currently they always set it to 0.

Also remove FeatureControlManager.latestFinalizedFeatures. It is not
needed and it does a lot of copying.

Reviewers: Jun Rao <junrao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-04-10 11:14:59 -04:00
José Armando García Sancio 988da9fc81 KAFKA-18991; Missing change for cherry-pick 2025-04-09 17:45:57 -04:00
TengYao Chi 5a95cb2793 KAFKA-18991: FetcherThread should match leader epochs between fetch request and fetch state (#19223)
This PR fixes a potential issue where the `FetchResponse` returns
`divergingEndOffsets` with an older leader epoch. This can lead to
committed records being removed from the follower's log, potentially
causing data loss.

In detail:
`processFetchRequest` gets the requested leader epoch of partition data
by `topicPartition` and compares it with the leader epoch of the current
fetch state. If they don't match, the response is ignored.

Reviewers: Jun Rao <junrao@gmail.com>
2025-04-09 17:45:57 -04:00
José Armando García Sancio b0ca05b751 KAFKA-18723; Better handle invalid records during replication (#18852)
For the KRaft implementation there is a race between the network thread,
which read bytes in the log segments, and the KRaft driver thread, which
truncates the log and appends records to the log. This race can cause
the network thread to send corrupted records or inconsistent records.
The corrupted records case is handle by catching and logging the
CorruptRecordException. The inconsistent records case is handle by only
appending record batches who's partition leader epoch is less than or
equal to the fetching replica's epoch and the epoch didn't change
between the request and response.

For the ISR implementation there is also a race between the network
thread and the replica fetcher thread, which truncates the log and
appends records to the log. This race can cause the network thread send
corrupted records or inconsistent records. The replica fetcher thread
already handles the corrupted record case. The inconsistent records case
is handle by only appending record batches who's partition leader epoch
is less than or equal to the leader epoch in the FETCH request.

Reviewers: Jun Rao <junrao@apache.org>, Alyssa Huang <ahuang@confluent.io>, Chia-Ping Tsai <chia7712@apache.org>
2025-04-09 17:45:56 -04:00
Florian Hussonnois 5c2ca4bd58 KAFKA-18962: Fix onBatchRestored call in GlobalStateManagerImpl (#19188)
Call the StateRestoreListener#onBatchRestored with numRestored and not
the totalRestored when reprocessing state

See: https://issues.apache.org/jira/browse/KAFKA-18962

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Matthias
Sax <mjsax@apache.org>
2025-04-09 13:36:41 -07:00
Luke Chen d1b381a185
KAFKA-17639 Add Java 23 to CI (#19396)
KAFKA-17639 Add Java 23 to CI.
Backported from Commit 76a9df4 and updated Jenkinsfile.

Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-04-09 18:10:07 +08:00
Parker Chang 94f42398f5 KAFKA-18984: Reset interval.ms By Using kafka-client-metrics.sh (#19213)
kafka-client-metrics.sh cannot reset the interval using `--interval=`.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-04-09 15:40:05 +08:00
Stig Døssing 392a56423e
KAFKA-17078: Add SecurityManagerCompatibility shim (#16522) (#19221)
Backport for 3.9 for https://github.com/apache/kafka/pull/16522

The reason to do this is that this is necessary in order for 3.9 to support Java 24.

Please see https://lists.apache.org/thread/6k942pphowd28dh9gn6xbnngk6nxs3n0 where it is being discussed whether to do this.

Co-authored-by: Greg Harris <greg.harris@aiven.io>

Reviewers: Luke Chen <showuon@gmail.com>, Greg Harris <greg.harris@aiven.io>
2025-04-07 10:39:24 +08:00
Stig Døssing 0f12ea4c08
KAFKA-17773 Upgrade spotbug to work under java 23 (3.9 backport) (#19310)
Cherry picked from commit 078760a008

Co-authored-by: Chia-Chuan Yu <yujuan476@gmail.com>

Reviewers: Luke Chen <showuon@gmail.com>
2025-04-07 10:27:36 +08:00
Stig Døssing e71b9ab3be
KAFKA-17653 Update Scala version to 2.13.15 for support Java 23 (3.9 backport) (#19307)
cherry picked from commit 9cb49092f0 in trunk

Co-authored-by: Ken Huang <s7133700@gmail.com>

Reviewers: Luke Chen <showuon@gmail.com>
2025-04-07 10:25:56 +08:00
Stig Døssing fd4c90a7c9
KAFKA-17723 Fix "this-escape" compiler warnings (MultiThreadedEventPr… (#19309)
Cherry picked from commit 2353a7c508

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-04-07 00:52:17 +08:00
Stig Døssing fe5802b304
KAFKA-17722 Fix "this-escape" compiler warnings (BrokerTopicMetrics) … (#19308)
Cherry picked from commit a880c846ae

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-04-07 00:48:37 +08:00
Ayoub Omari a78491af79 KAFKA-16407: Fix foreign key INNER join on change of FK from/to a null value (#19303)
Fixes both KAFKA-16407 and KAFKA-16434.

Summary of existing issues:

- We are ignoring new left record when its previous FK value is null
- We do not unset foreign key join result when FK becomes null

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-04-05 21:26:28 -07:00
Stig Døssing fb9aa10677
MINOR: Update Mockito on 3.9 for Java 23 support (#19367)
This was done on trunk in 6a37d5cceb

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-04-04 23:47:00 +08:00
Stig Døssing d3fa770c58
MINOR: Backport Gradle upgrades to 3.9 (#19365)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-04-04 23:40:16 +08:00
nilmadhab mondal d37f884035 KAFKA-18713: Fix FK Left-Join result race condition (#19005)
When a row in a FK-join left table is updated, we should send a "delete
subscription with no response" for the old FK to the right hand side, to
avoid getting two responses from the right hand side. Only the "new
subscription" for the new FK should request a response. If two responses
are requested, there is a race condition for which both responses could
be processed in the wrong order, leading to an incorrect join result.

This PR fixes the "delete subscription" case accordingly, to no request
a response.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-04-03 17:23:01 -07:00
Jorge Esteban Quilcate Otoya c37ac21cc9
KAFKA-15931: Cancel RemoteLogReader gracefully (#19150)
Backports f24945b519 to 3.9

Instead of reopening the transaction index, it cancels the RemoteFetchTask without interrupting it--avoiding to close the TransactionIndex channel.

This will lead to complete the execution of the remote fetch but ignoring the results. Given that this is considered a rare case, we could live with this. If it becomes a performance issue, it could be optimized.

Reviewers: Jun Rao <junrao@gmail.com>
2025-04-01 14:10:12 -07:00
Matthias J. Sax 4b86ff9d00
KAFKA-18943: Update EosIntegrationTest for EOSv1 (#19312)
After cherry-picking
2181ddbb03,
we realized that the newly added test does not cover EOSv1. This PR closes this testing gap.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-03-31 10:56:58 -07:00
Matthias J. Sax 90ee2d2b34 KAFKA-18943: Kafka Streams incorrectly commits TX during task revokation (#19164)
Fixes two issues:
 - only commit TX if no revoked tasks need to be committed
 - commit revoked tasks after punctuation triggered

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Anna Sophie Blee-Goldman <sophie@responsive.dev>, Bruno Cadonna <bruno@confluent.io>, Bill Bejeck <bill@confluent.io>
2025-03-13 11:28:26 -07:00
David Jacot bf9912a1eb KAFKA-18046; High CPU usage when using Log4j2 (#19138)
This patch is a first step towards resolving KAFKA-18046. Apache Kafka
4.0 ships with log4j2 so the issue raised in the ticket causing high CPU
usage on the fetch path due to LoggerFactory.getLogger() being called on
the handling of all fetch responses is not good. Hence, I propose to fix
that one by caching the Logger used by the `CompletedFetch` class.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2025-03-07 09:08:04 +01:00
Matthias J. Sax d23107e71f MINOR: reduce per-batch logging to TRACE level (#19101)
Logging on a per-batch bases is very chatty, and should only be done at
TRACE level to avoid spamming DEBUG logs.

Reviewers: Justine Olshan <jolshan@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2025-03-06 14:37:19 -08:00
PoAn Yang 1ec1043d51
KAFKA-18844 Stale features information in QuorumController#registerBroker (#19058)
In #16848, we added `kraft.version` to finalized features and got finalized features outside controller event handling thread. This may make finalized features stale when processing `registerBroker` event. Also, some cases like `QuorumControllerTest.testBalancePartitionLeaders` become flaky cause of outdated MV. This PR moves finalized features back to controller event handling thread to avoid the error.

Reviewers: Ismael Juma <ijuma@apache.org>, Jun Rao <junrao@gmail.com>, Colin P. McCabe <cmccabe@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-04 15:42:51 +08:00
PoAn Yang 4d0216dd9f KAFKA-18281: Kafka is improperly validating non-advertised listeners for routable controller addresses (#18387)
When a cluster is configured with a dynamic controller quorum, KRaft replica's endpoint are computed using the advertised.listeners property and not the quorum.controller.voters property. This change in the configuration makes it difficult to keeping all previous node configurations compatible with the new endpoint discovery functionality.

The least intrusive solution is to rely on Kafka's reverse hostname lookup when the hostname is not specified. The effective advertised controller listener now remove '0.0.0.0' hostname if the endpoint came from the listener configuration and not the advertised.listener configuration.

Reviewers: José Armando García Sancio <jsancio@apache.org>, Alyssa Huang <ahuang@confluent.io>
2025-02-24 20:12:44 -07:00
Ismael Juma 9142740cb3 MINOR: Remove request log space added inadvertently (#19011)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-23 13:47:03 -08:00
Luke Chen 66e2ac0e09
MINOR: add docs for "org.apache.kafka.sasl.oauthbearer.allowed.urls" in v3.9 (#18940)
add docs for "org.apache.kafka.sasl.oauthbearer.allowed.urls" in v3.9.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2025-02-18 17:13:09 +08:00
Matthias J. Sax b7481ba89b HOTFIX: StoreChangelogReader should require stable consumer group (#18901)
Fixing regression bug, introduced by beac86f049

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bruno Cadonna <bruno@confluent.io>
2025-02-17 22:24:12 -08:00
Jhen-Yung Hsu 0c288599c5 KAFKA-18803 The acls would appear at the wrong level of the metadata shell "tree" (#18916)
Reviewers: David Arthur <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-17 03:57:41 +08:00
Edoardo Comar c455c10405 KAFKA-18758: NullPointerException in shutdown following InvalidConfigurationException (#18833)
Add checks for null in shutdown as BrokerLifecycleManager is not instantiaited if LogManager constructor throws an Exception
2025-02-11 10:51:23 +00:00
PoAn Yang 27a3e5560e
KAFKA-806 Index may not always observe log.index.interval.bytes (#18843)
Currently, each log.append() will add at most 1 index entry, even when the appended data is larger than log.index.interval.bytes. One potential issue is that if a follower restarts after being down for a long time, it may fetch data much bigger than log.index.interval.bytes at a time. This means that fewer index entries are created, which can increase the fetch time from the consumers.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Jun Rao <junrao@gmail.com>
2025-02-11 01:24:19 +08:00
Ming-Yen Chung c215b8b645
KAFKA-18675 Add unit test to verify space separated brokers won't cause exception for 3.8 and 3.9 (#18767)
Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-05 16:55:10 +08:00
PoAn Yang 6b2f2aa2f1 KAFKA-18028 the effective kraft version of --no-initial-controllers should be 1 rather than 0 (#17836)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-04 09:29:28 -08:00
Justin Lee 8831f5b133 KAFKA-18001: Support UpdateRaftVoterRequest in KafkaNetworkChannel (#17773)
Adds support for UpdateRaftVoterRequest in KafkaNetworkChannel. This addresses the following scenario:

* Bootstrap a KRaft Controller quorum in dynamic mode
* Start additional controllers (as observers)
* Update kraft.version feature from 0 to 1
* Use kafka-metadata-quorum add-controller to promote an observer controller to a follower

Reviewers: Colin Patrick McCabe <cmccabe@apache.org>, Alyssa Huang <ahuang@confluent.io>
2025-02-03 17:05:15 -08:00
Chung, Ming-Yen 5a074a60df
KAFKA-18171: Revert the strict config validation for 3.8 and 3.9 (#18741)
* Revert "KAFKA-16946: Utils.getHost/getPort cannot parse SASL_PLAINTEXT://host:port (#16319)"

This reverts commit 09bc5be63e.

* Revert "KAFKA-16824: Utils.getHost and Utils.getPort do not catch a lot of invalid host and ports. (#16048)"

This reverts commit 0971924ebc.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-29 22:18:29 +00:00
Ismael Juma 6b82a4cc6a
KAFKA-18663: Metadata v0-v3 should be undeprecated (#18736)
See KAFKA-18648 for details.

Reviewers: David Arthur <mumrah@gmail.com>
2025-01-29 06:38:24 -08:00