Commit Graph

14999 Commits

Author SHA1 Message Date
Lucas Brutschy 9ef4d5ab86 KAFKA-18917: TransformValues throws NPE (#19089)
When `transformValues` is used with a `Materialized` instance, but
without a queryable name, a `NullPointerException` is thrown. To
preserve the semantics present in 3.9, we need to avoid materialization
when a queryable name is not present.

Reviewers: Bruno Cadonna <cadonna@apache.org>
2025-03-04 17:51:46 +01:00
mingdaoy 1075021c4a KAFKA-18876 4.0 documentation improvement (#19065)
1. add prefix "config" to the commands' properties
2. add missed sections (6.11 and 6.12)
3. fix some incorrect commands

Reviewers: David Jacot <djacot@confluent.io>, Ken Huang <s7133700@gmail.com>, TengYao Chi <kitingiao@gmail.com>, Jun Rao <junrao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-05 00:22:45 +08:00
David Jacot 1b424d2f3d KAFKA-18916; Resolved regular expressions must update the group by topics data structure (#19088)
When regular expressions are resolved, they do not update the group by
topics data structure. Hence, topic changes (e.g. deletion) do not
trigger a rebalance of the group.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-03-04 15:32:10 +01:00
Matthias J. Sax dadd02de8b
HOTFIX: remove PageView example to support Java11 for :streams:examples module (#19052)
The PageView example depends on Connect to pull in Json (de)serializers,
but Connect does not support Java11 any longer.

To allow supporting Java11 for the Kafka Streams examples, this PR
removes the PageView examples and Connect dependency.

Reviewers: Bruno Cadonna <bruno@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>
2025-03-03 10:00:15 -08:00
David Jacot 145789a086 MINOR: Don't print cleaning group metadata log if empty (#19080)
The new group coordinator prints the following line at fixed interval
even if no groups were deleted:

```
Generated 0 tombstone records while cleaning up group metadata in 0 milliseconds. (org.apache.kafka.coordinator.group.GroupCoordinatorShard)
```

The time component has some value in its own but it may be better to not
print if when there are not records in order to reduce the spam in the
logs.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-03-03 18:10:37 +01:00
PoAn Yang 69186480dc KAFKA-18844: Stale features information in QuorumController#registerBroker (#18997)
In https://github.com/apache/kafka/pull/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-03 15:17:01 +01:00
Xuan-Zhang Gong 9516b3bdd0 KAFKA-18864:remove the Evolving tag from stable public interfaces (#19036)
The purpose of this PR is to remove the `@InterfaceStability.Evolving` from classes that were created over a year ago.

Reviewers: Jun Rao <junrao@gmail.com>
2025-03-03 15:14:33 +01:00
Bruno Cadonna d91fbc7fa7 HOTFIX: Revert "KAFKA-18067: Kafka Streams can leak Producer client under EOS (#17931)" (#19078)
This reverts commit e8837465a5.

The commit that is reverted prevents Kafka Streams from re-initializing
its transactional producer. If an exception that fences the
transactional producer occurs, the producer is not re-initialized during
the handling of the exception. That causes an infinite loop of
ProducerFencedExceptions with corresponding rebalances.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, David Jacot
<djacot@confluent.io>
2025-03-03 13:39:59 +01:00
TengYao Chi d8bfd80486 KAFKA-18908 Document that the size of appended value can't be larger than Short.MAX_VALUE (#19067)
JIRA: KAFKA-18908
`ZooKeeper` mode allows large configuration values to be created through
an append operation. `KRaft` mode restricts configuration values to a
maximum size of `Short.MAX_VALUE`.
We should document this behavioral change.

Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-03 03:01:04 +08:00
Logan Zhu ae798f12be KAFKA-18868 add the "default value" explanation to the docs of num.replica.alter.log.dirs.threads (#19038)
Update the documentation for the `num.replica.alter.log.dirs.threads` configuration to clarify that its default value is determined by the number of log directories specified in the `log.dirs` configuration.

Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-01 22:38:04 +08:00
TengYao Chi e7a13f759e KAFKA-18860 Remove Missing Features section (#19048)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-28 06:39:36 +08:00
ClarkChen 2f9da4691f KAFKA-18849 Add "strict min ISR" to the docs of "min.insync.replicas" (#19016)
KIP-966 adds strict min ISR rule, so this PR improves the docs of min.insync.replicas to include that change.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-27 16:05:50 +08:00
Nick Guo 242573d7de KAFKA-18850 Fix the docs of org.apache.kafka.automatic.config.providers (#19039)
Reviewers: TengYao Chi <kitingiao@gmail.com>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@apache.org>
2025-02-27 15:37:13 +08:00
Xuan-Zhang Gong 32d012fd8e KAFKA-18869 add remote storage threads to "Updating Thread Configs" section (#19037)
Reviewers: Chia-Ping Tsai <chia7712@apache.org>
2025-02-27 10:11:15 +08:00
Dongnuo Lyu 8e44ddccb5
KAFKA-18813: ConsumerGroupHeartbeat API and ConsumerGroupDescribe API… (#19042)
… must check topic describe (#18989)

This patch filters out the topic describe unauthorized topics from the
ConsumerGroupHeartbeat and ConsumerGroupDescribe response.

In ConsumerGroupHeartbeat,
- if the request has `subscribedTopicNames` set, we directly check the
authz in `KafkaApis` and return a topic auth failure in the response if
any of the topics is denied.
- Otherwise, we check the authz only if a regex refresh is triggered and
we do it based on the acl of the consumer that triggered the refresh. If
any of the topic is denied, we filter it out from the resolved
subscription.

In ConsumerGroupDescribe, we check the authz of the coordinator
response. If any of the topic in the group is denied, we remove the
described info and add a topic auth failure to the described group.
(similar to the group auth failure)

(cherry picked from commit 36f19057e1)

Reviewers: David Jacot <djacot@confluent.io>, Lianet Magrans
<lmagrans@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>,
Chia-Ping Tsai <chia7712@gmail.com>, TaiJuWu <tjwu1217@gmail.com>,
TengYao Chi <kitingiao@gmail.com>
2025-02-26 16:53:46 -05:00
Ismael Juma d8642407cd MINOR: Remove old message format documentation (#19033)
Link to the older version of the documentation for people who care about
the old message format.

Reviewers: Jun Rao <junrao@apache.org>, Chia-Ping Tsai <chia7712@apache.org>
2025-02-26 09:36:49 -08:00
A. Sophie Blee-Goldman ed23f6be90 KAFKA-18839: Drop EAGER rebalancing support in Kafka Streams (#18988)
In 3.1 we deprecated the eager rebalancing protocol and marked it for
removal in a later release. We aim to officially drop support and remove
the protocol from Streams in 4.0.

The effect of this PR is that it will no longer be possible to perform a
live upgrade Kafka Streams directly to 4.0 from version 2.3 or below.
Users will have to go through a bridge release between 2.4 - 3.9
instead.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-02-25 19:08:51 -08:00
TengYao Chi da3b8e88dc MINOR: Add a separate page for zk2kraft.html (#18961)
Reviewers: mingdaoy <mingdaoy@gmail.com>, Ken Huang <s7133700@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-26 05:40:16 +08:00
PoAn Yang eacf49f320 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 19:52:28 -07:00
Calvin Liu 6cad956d1a MINOR: update truncation test (#18952)
Reduce the minISR to be 1 for the truncation test in order to skip the protection from KIP-966

Reviewers: David Jacot <djacot@confluent.io>, Colin P. McCabe <cmccabe@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-24 15:20:48 -08:00
Calvin Liu e8cc75b8ce KIP-966 part 1 release doc (#18898)
Add notes to explain how ELR and how to manage ELR.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2025-02-24 15:19:42 -08:00
Ismael Juma 4e9d2feabc MINOR: Remove request log space added inadvertently (#19011)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-23 13:19:25 -08:00
Ismael Juma da8f390c45 MINOR: Update upgrade notes for 4.0.0 (#18960)
Details:
1. Upgrades to 4.0.x are only supported from 3.3.x and for kraft mode clusters
2. Add rolling upgrade instructions for 4.0.x
3. Clarify the message for zk to kraft migrations
4. Remove all the upgrade instructions for older versions (they can still be found in the upgrade notes for older releases)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>
2025-02-23 13:18:57 -08:00
Calvin Liu 44495e4dde KAFKA-15583 doc update for the "strict min ISR" rule (#18880)
Reviewers: Matthias J. Sax <matthias@confluent.io>, Dave Troiano <dtroiano@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-23 13:09:24 +08:00
Ken Huang 104b097af0 MINOR: Fix fail e2e transactions_upgrade_test.py::TransactionsUpgradeTest.test_transactions_upgrade (#19004)
The main root cause is
3dba3125e9,
this PR remove the metadata version which is older than 3.3, thus this
test will fail when it use metadata version 3.2, 3.1

Reviewers: David Jacot <djacot@confluent.io>
2025-02-22 14:45:56 +01:00
David Jacot 9c279e79ed MINOR: Update version is doc (#19006)
This patch updates the version in the documentation.
2025-02-22 12:37:41 +01:00
TengYao Chi 2a9241b855 MINOR: Fix fail e2e TestUpgrade#test_combined_mode_upgrade and test_isolated_mode_upgrade (#19003)
#18845 assumed a baseline of 3.3 for server protocol versions so that
the lower version couldn't roll up to 4.0. Hence, the
`TestUpgrade#test_combined_mode_upgrad` and `test_isolated_mode_upgrade`
failed for the 3.1 and 3.2 versions.

e2e tests result with this patch on jenkins:
![Screenshot from 2025-02-22
13-22-17](https://github.com/user-attachments/assets/2de6f707-8281-4f30-b5d0-83dd4de9666d)
e2e tests result with this patch on local machine:
![Screenshot from 2025-02-22
13-28-16](https://github.com/user-attachments/assets/2e5e563a-1ac4-4894-ba30-593304697d1d)

Reviewers: David Jacot <djacot@confluent.io>
2025-02-22 08:54:02 +01:00
Ken Huang 3a2af722a3 MINOR: Fix fail e2e TransactionsMixedVersionsTest#test_transactions_mixed_versions (#19002)
The main root cause is
3dba3125e9,
this PR remove the metadata version which is older than 3.3, thus this
test will fail when it use metadata version 3.2, 3.1

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>
2025-02-22 08:53:55 +01:00
Apoorv Mittal 169712de78
Revert "KAFKA-16803: Change fork, update ShadowJavaPlugin to 8.1.7 (#16295)" (#19000)
The PR: https://github.com/apache/kafka/pull/16295 which changed the
shadow plugin version has re-introduced the issue with publication of
signed jars, fixed in: https://github.com/apache/kafka/pull/15308.

This PR reverts https://github.com/apache/kafka/pull/16295 to unblock
Kafka 4.0 release. And we should aim for fixing the issue permanently as
being discussed here: https://github.com/apache/kafka/pull/18018.

Seems same issue was encountered during `Kafka-3.9` release and same
commit was reverted in 3.9 as well:
https://github.com/apache/kafka/pull/17218.

Reviewers: David Jacot <djacot@confluent.io>
2025-02-22 08:47:48 +01:00
David Jacot bb89151752 MINOR: Update release script for 4.0 (#18999)
This patch updates the release script to use JDK 21 to build the
release. We could also use JDK 17 but using JDK 21 directly does not
change much. We have to verify anyway that the server works with 17 and
the client with 11.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-02-21 20:31:13 +01:00
Lianet Magrans 364479cf24 KAFKA-18813: [3/N] Client support for TopicAuthException in DescribeConsumerGroup path (#18996)
Reviewers: David Jacot <djacot@confluent.io>
2025-02-21 12:42:46 -05:00
Calvin Liu 8383c88a70 MINOR: Move the ELR default version to 4.1 (#18954)
- ELR is enabled (ELRV_1) by default if the cluster is created with its bootstrap metadata version >= IBP_4_1_IV0.
- ELRV_1 can be manually enabled iff the metadata version is >= IBP_4_0_IV1.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Colin P. McCabe <cmccabe@apache.org>, David Jacot <djacot@confluent.io>
2025-02-21 16:13:47 +01:00
Lianet Magrans f026b1cd58 KAFKA-18813: [2/N] Client support for TopicAuthException in HB path (#18986)
Reviewers: David Jacot <djacot@confluent.io>
2025-02-21 08:47:40 -05:00
TengYao Chi 2f181c92d3 KAFKA-18737 KafkaDockerWrapper setup functions fails due to storage format command (#18844)
The current Docker Hub documentation for Kafka is based on the use of static voters. Since Kafka 4.0 utilizes dynamic voters, users following the doc of docker hub may encounter unexpected behavior. Due to the limited time available for the 4.0.0 release, a simple and quick solution is to revert to using static voters within the Docker image. This can be achieved by adding a configuration file with static voter definitions to the kafka/docker folder, keeping it separate from the main kafka/config directory. This approach allows us to encourage the use of dynamic voters in typical deployments while maintaining compatibility within the Docker image.

Reviewers: Vedarth Sharma <142404391+VedarthConfluent@users.noreply.github.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-21 20:45:23 +08:00
David Jacot ad89f9edc0 MINOR: Rearrange configs in GroupCoordinatorConfigs (#18970)
I was looking into GroupCoordinatorConfigs to review configurations that
we will ship with Apache Kafka 4.0. I found out that it was pretty
disorganised. This patch cleans up the format and re-groups the
configurations which are related.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-21 13:21:41 +01:00
Shivsundar R c7db98e15e
KAFKA-18829: Added check before converting to IMPLICIT mode (#18964) (Cherry-pick) (#18982)
Cherry-picked
3603c8fe35
into 4.0.
This was a bug fix to address
https://issues.apache.org/jira/browse/KAFKA-18829.
Now, we will only move to IMPLICIT mode in `ShareConsumerImpl`, if there
were any records to be acknowledged, and if the next
`poll()`/`commitAsync()`/`commitSync()` was called.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-02-21 09:28:41 +00:00
TengYao Chi d3791c39e3 KAFKA-18831 Migrating to log4j2 introduce behavior changes of adjusting level dynamically (#18969)
fix the following behavior changes.

1) in log4j 1, users can't change the logger by parent if the logger is declared by properties explicitly. For example, `org.apache.kafka.controller` has level explicitly in the properties. Hence, we can't use "org.apache.kafka=INFO" to change the level of `org.apache.kafka.controller` to INFO. By contrast, log4j2 allows us to change all child loggers by the parent logger.

2) in log4j2, we can change the level of root to impact all loggers' level. By contrast, log4j 1 can't.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-21 16:16:38 +08:00
TengYao Chi 35a372c71d KAFKA-18641: AsyncKafkaConsumer could lose records with auto offset commit (#18737)
Reviewers: Lianet Magrans <lmagrans@confluent.io>, Jun Rao <jun@confluent.io>, Kirk True <ktrue@confluent.io>
2025-02-20 12:17:25 -05:00
Calvin Liu 8a08ca676f MINOR: Deflake EligibleLeaderReplicasIntegrationTest (#18923)
Make sure to give enough time for the partition ISR updates.

Reviewers: David Jacot <djacot@confluent.io>
2025-02-20 14:14:54 +01:00
S.Y. Wang ba52124a87 MINOR: Fix typo in ClusterControlManager (#18886)
Reviewers: TengYao Chi <kitingiao@gmail.com>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-19 09:57:26 -08:00
Calvin Liu 909fae1aaa MINOR: Fix incorrect return value from upgradeFeatures #18958
Reviewers: Colin P. McCabe <cmccabe@apache.org>
2025-02-19 09:44:05 -08:00
Kaushik Raina eacdb09cd7 Add TransactionAbortableException and Timeout Exception handling instruction in docs (#18942)
Add instruction for handing TransactionAbortableException and TimeoutException at application side.

Reviewers: Justine Olshan <jolshan@confluent.io>
2025-02-19 09:16:52 -08:00
Ismael Juma 3fbbd0a3ee KAFKA-18601: Assume a baseline of 3.3 for server protocol versions (#18845)
3.3.0 was the first KRaft release that was deemed production-ready and also
when KIP-778 (KRaft to KRaft upgrades) landed. Given that, it's reasonable
for 4.x to only support upgrades from 3.3.0 or newer (the metadata version also
needs to be set to "3.3" or newer before upgrading).

Noteworthy changes:
1. `AlterPartition` no longer includes topic names, which makes it possible to
simplify `AlterParitionManager` logic.
2. Metadata versions older than `IBP_3_3_IV3` have been removed and
`IBP_3_3_IV3` is now the minimum version.
3. `MINIMUM_BOOTSTRAP_VERSION` has been removed.
4. Removed `isLeaderRecoverySupported`, `isNoOpsRecordSupported`,
`isKRaftSupported`, `isBrokerRegistrationChangeRecordSupported` and
`isInControlledShutdownStateSupported` - these are always `true` now.
Also removed related conditional code.
5. Removed default metadata version or metadata version fallbacks in
multiple places - we now fail-fast instead of potentially using an incorrect
metadata version.
6. Update `MetadataBatchLoader.resetToImage` to set `hasSeenRecord`
based on whether image is empty - this was a previously existing issue that
became more apparent after the changes in this PR.
7. Remove `ibp` parameter from `BootstrapDirectory`
8. A number of tests were not useful anymore and have been removed.

I will update the upgrade notes via a separate PR as there are a few things that
need changing and it would be easier to do so that way.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Jun Rao <junrao@gmail.com>, David Arthur <mumrah@gmail.com>, Colin P. McCabe <cmccabe@apache.org>, Justine Olshan <jolshan@confluen.io>, Ken Huang <s7133700@gmail.com>
2025-02-19 05:57:04 -08:00
Ismael Juma bfb0f787e7 MINOR: Java version and TLS documentation improvements (#18822)
Most of the changes are obvious clean-ups/fixes. A couple of noteworthy items:

1. Support for non LTS versions is clarified (we were incorrectly stating full support
for Java 23).
2. TLS version negotiation details are clarified.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-19 05:36:46 -08:00
David Jacot 6f1e1884e3 MINOR: Tweak default group coordinator config & upgrade notes (#18948)
This patch changes the default value of `group.coordinator.threads` to `4` and sets it priority to `HIGH`. This change makes it consistent with how we handle `num.network.threads` and `num.io.threads`. The patch also tweaks the upgrade notes.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-02-18 20:06:24 +01:00
Parker Chang b91f64ceb9 MINOR: Fix the missing and updated licenses (#18950)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-19 01:38:49 +08:00
PoAn Yang 546d9ce39b KAFKA-18773 Migrate the log4j1 config to log4j 2 for native image and README (#18872)
- update reflection-config.json and resource-config.json to include log4j2 and jackson
- remove unused jackson scala library
- fix the incorrect path of log4j2.yaml
- adopt workaround (--standalone) to make this PR work and it will be fixed by KAFKA-18737)

Reviewers: TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-19 00:49:23 +08:00
David Jacot 421b9a6f0c MINOR: Update LICENSE-binary (#18943)
Before the patch:
```
% python3 ./committer-tools/verify_license.py

...

All libs from ./libs are present in the LICENSE file.

The following entries are in the LICENSE file but not present in ./libs. These should be removed from the LICENSE-binary file:
 - audience-annotations-0.12.0
 - jackson-jaxrs-base-2.16.2
 - jackson-jaxrs-json-provider-2.16.2
 - jackson-module-jaxb-annotations-2.16.2
 - jakarta.inject-2.6.1
 - javax.servlet-api-3.1.0
 - jetty-continuation-9.4.56.v20240826
 - jetty-servlet-9.4.56.v20240826
 - jetty-servlets-9.4.56.v20240826
 - jetty-util-ajax-9.4.56.v20240826
 - jsr305-3.0.2
 - log4j-core-test-2.24.1
```

After the patch:
```
% python3 ./committer-tools/verify_license.py

...

All libs from ./libs are present in the LICENSE file.

No extra dependencies in the LICENSE file.
```

Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-02-18 13:24:31 +01:00
David Jacot e050a1f2d5 MINOR: Add verify_license tool (#18931)
This patch adds the verify_license.py tool. It compares the libraries shipped within the tarball to the LICENSE file, and vice versa, to ensure that they are aligned. It also slightly update the format of the LICENSE file to make it easier to parse it.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Mickael Maison <mickael.maison@gmail.com>
2025-02-18 12:08:15 +01:00
Luke Chen 10c849f55d MINOR: add docs for "org.apache.kafka.sasl.oauthbearer.allowed.urls" (#18938)
add docs for "org.apache.kafka.sasl.oauthbearer.allowed.urls"

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
2025-02-18 16:48:51 +08:00