Commit Graph

15264 Commits

Author SHA1 Message Date
xijiu a6064e0800
KAFKA-17607: Add CI step to verify LICENSE-binary (#18299)
Add the verify_license.py script to our build to detect missing licenses.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Ken Huang <s7133700@gmail.com>, David Arthur <mumrah@gmail.com>
2025-03-07 09:45:23 -05:00
Dániel Urbán 40db001588
KAFKA-18929: Log a warning when time based segment delete is blocked by a future timestamp (#19137)
When producers send future timestamps, time retention based log segments
may get blocked from removal for an extended period of time. Log
cleaning should should warn in the logs when this scenario occurs.

Reviewers: Viktor Somogyi-Vass <viktorsomogyi@gmail.com>
2025-03-07 14:31:22 +01:00
Jorge Esteban Quilcate Otoya 269e8892ad
KAFKA-15931: Reopen TransactionIndex if channel is closed (#15241)
Cached TransactionIndex may get closed if interrupted, causing following calls to always fail with ClosedChannelException, and forcing process to be restarted. In order to avoid this issue, a new method is exposed by TransactionIndex to validate state of channel; and index is reopened if closed.

Reviewers: Luke Chen <showuon@gmail.com>, Kamal Chandraprakash<kamal.chandraprakash@gmail.com>, Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com>
2025-03-07 19:31:21 +08:00
David Jacot 8cf2f9a61a
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 00:03:32 -08:00
Colin Patrick McCabe f31208d443
MINOR: zk2kraft: add more information about kafka-configs.sh (#19100)
Add information about setting dynamic log levels and dynamic
configurations on KRaft controllers.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-07 11:27:18 +08:00
ClarkChen 870db5d811
KAFKA-18915: Migrate AdminClientRebootstrapTest to use new test infra (#19094)
Migrate AdminClientRebootstrapTest to the new test infra and remove the
old Scala test.

Reviewers: TengYao Chi <kitingiao@gmail.com>, David Arthur <mumrah@gmail.com>
2025-03-06 16:05:51 -05:00
Matthias J. Sax d85946da19
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 11:06:26 -08:00
Iamoshione a9bc7c5889
KAFKA-18766:Docs: Make usage of allow.everyone.if.no.acl.found config clearer (#19077)
In the documentation today, we have the following sentence:

By default, if no ResourcePatterns match a specific Resource R, then R
has no associated ACLs, and therefore no one other than super users is
allowed to access R. If you want to change that behavior, you can
include the following in server.properties.

Reviewers: TengYao Chi <kitingiao@gmail.com>, Andrew Schofield <aschofield@confluent.io>
 

Although, it is correct, I have observed users being confused by it. I
think could me made clearer that default is deny and this property is a
way to change default.
Change

Replace the above with the following:

 

Default Behavior Without ACLs:

If a resource (R) does not have any ACLs defined—that is, if no ACL
matches the resource—Kafka will restrict access to that resource. In
this situation, only super users are allowed to access it.

Changing the Default Behavior:

If you prefer that resources without any ACLs be accessible by all users
(instead of just super users), you can change the default behavior. To
do this, add the following line to your server.properties file:

 

allow.everyone.if.no.acl.found=true

With this setting enabled, if a resource does not have any ACLs defined,
Kafka will allow access to everyone. If a resource has one or more ACLs
defined, those ACL rules will be enforced as usual, regardless of the
setting.
2025-03-06 18:03:41 +00:00
Andrew Schofield 1da30bdedf
KAFKA-18900: Experimental share consumer acknowledge mode config (#19113)
User testing of the `KafkaShareConsumer` interface has revealed some
areas which confuse people. One of these is that way that it decides
whether you want to use implicit or explicit acknowledgement of records
by observing which calls the application issues. We are taking the
opportunity to refine the interface before it is finalised.

This PR introduces an experimental configuration called
`internal.share.acknowledgement.mode` which can be used to make the
application declare which kind of acknowledgement it wishes to use. We
plan to try out the configuration, assess whether it has helped, and
then create a proper consumer configuration that makes this area better.
That would require a lot of change in the tests, which explains why this
initial PR only has a small number of tests.

Reviewers: David Arthur <mumrah@gmail.com>
2025-03-06 17:57:11 +00:00
David Arthur 88f8255732
MINOR Increase JUnit max forks and memory for CI (#18560)
Increase the max number of forks for each JUnit task to 4. Also increase
the amount of memory given to forked workers to 3g.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-03-06 12:48:21 -05:00
Ismael Juma a738df4aaa
KAFKA-18648: Make `records` in `FetchResponse` nullable again (#19131)
As Jun raised in
https://github.com/apache/kafka/pull/18726#discussion_r1972525165,
we actually do have a few code paths where `records` remains `null`
in the FetchResponse with broker version 3.9 and older:

* Compression codec for topic is ZSTD and fetch version < 10:
https://github.com/apache/kafka/blob/3.9/core/src/main/scala/kafka/server/KafkaApis.scala#L835
* Down-conversion of zstandard-compressed:
https://github.com/apache/kafka/blob/3.9/core/src/main/scala/kafka/server/KafkaApis.scala#L884
* Generic uncaught exception through:
https://github.com/apache/kafka/blob/3.9/clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java#L365

To ensure 4.0 clients don't fail to deserialize fetch responses from
brokers with the affected versions, we make `records` nullable again.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Jun Rao <junrao@gmail.com>
2025-03-06 09:12:36 -08:00
Ismael Juma e9ed67d34a
MINOR: Update log4j2 to 2.24.3 (#19135)
2.24.2 includes a critical fix:

"This release fixes a critical bug in Log4j API initialization code,
which can cause LogManager.getLogger() to return null under certain
conditions. See https://github.com/apache/logging-log4j2/issues/3143 for
details."

2.24.3 includes an important fix for our usage:

"Fix ConcurrentModificationException, if multiple threads modify loggers
concurrently.
This bug affects users that modify logger levels programmatically."

Release notes:
* https://github.com/apache/logging-log4j2/releases/tag/rel%2F2.24.2
* https://github.com/apache/logging-log4j2/releases/tag/rel%2F2.24.3

Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai
<chia7712@gmail.com
2025-03-06 09:11:29 -08:00
Alieh Saeedi 7a976c651e
KAFKA-18887: Implement Streams Admin APIs (#19120)
Implement Admin API extensions beyond list/describe group (delete group,
offset-related APIs).

* adds methods for describing and manipulating offsets, as described in
KIP-1071
* adds corresponding unit tests

These are doing the exact same thing as the corresponding consumer group
counter-parts.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-03-06 17:55:21 +01:00
Lucas Brutschy 7fcee6f459
MINOR: transformValues test improvement (#19106)
Follow-up to 295760d3eb. Also check the
set of state stores as suggested in reviews.

Reviewers: Bruno Cadonna <cadonna@apache.org>
2025-03-06 17:54:30 +01:00
Sushant Mahajan b89c819f63
MINOR: Added evolving annotation to DeleteShareGroupsResult. (#19133)
* Added `InterfaceStability.Evolving` annotation to`DeleteShareGroupsResult`.
* Fixed some java doc.

Co-authored-by: Andrew Schofield <aschofield@confluent.io>

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-03-06 16:17:37 +00:00
David Arthur c9804344de
HOTFIX Disable branch protections on trunk (#19139)
This reverts the branch protections added in #19122

Reviewers: David Jacot <david.jacot@gmail.com>
2025-03-06 10:33:56 -05:00
Chirag Wadhwa 899cdb598a
KAFKA-18811: Added command configs to admin client as well in VerifiableShareConsumer (#19130)
This PR includes a new flag in VerifiableShareConsumer.java called
command.config to include a properties file for admin client
related configs

Co-authored-by: Andrew Schofield <aschofield@confluent.io>

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-03-06 13:27:15 +00:00
TengYao Chi 6ad9ca518c
MINOR: Cleanup import-control-core.xml (#19095)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-03-06 19:45:08 +08:00
David Jacot b4cc88f6c4
MINOR: Update upgrade steps (#19132)
Using `bin/kafka-features.sh upgrade --metadata 4.0` to finalize the
upgrade is deprecated and furthermore it does not bump all the other
feature flags. Hence we should recommend to use `bin/kafka-features.sh
upgrade --release-version 4.0` in the documentation. This change was
introduced in [KIP-1022: Formatting and Updating
Features](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1022%3A+Formatting+and+Updating+Features).

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2025-03-06 02:22:03 -08:00
mingdaoy 21358342f4
MINOR: Improve the example of kafka-metadata-shell.sh (#19107)
Reviewers: Jhen-Yung Hsu <jhenyunghsu@gmail.com>, TengYao Chi <kitingiao@gmail.com>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-06 17:32:07 +08:00
Ken Huang 041d8019d6
KAFKA-18910 Remove kafka.utils.json (#19112)
Reviewers: TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-06 14:11:20 +08:00
dengziming 50510bb19d
HOTFIX: Do not use highest version when version is valid (#19109)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-03-06 10:15:58 +08:00
David Arthur 56fc8e9d2a
HOTFIX Fix asf.yaml strict [2/n] (#19126)
Change the `strict` value back to false. Follow-up of #19124

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-03-05 17:49:29 -05:00
David Arthur ebf22ddab6
HOTFIX Fix asf.yaml strict [1/n] (#19124)
Per ASF Infra's instructions, we need to reapply this .asf.yaml change.

We'll do that by setting it to "true", then back to "false"

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-03-05 17:32:14 -05:00
David Arthur da7d56a5cc
MINOR Add a required status check for trunk (#19122)
Add a single job that runs after the whole CI pipeline and make it a
required check before merging a PR. This will prevent us from merging
PRs which have not run through the CI.

Reviewers: Justine Olshan <jolshan@confluent.io>
2025-03-05 14:48:46 -05:00
David Arthur d86cb59790 Revert "KAFKA-18887: Implement Streams Admin APIs (#19049)"
This reverts commit 017692e86c.
2025-03-05 10:49:11 -05:00
Sushant Mahajan 485699a187
MINOR: Delete DeleteGroupsResult class. (#19057)
In this PR, we perform this refactor as the class is not needed since
there is no need to refer to child classes by common ref and the
duplicated code is minimal.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-03-05 14:38:18 +00:00
Alieh Saeedi 017692e86c
KAFKA-18887: Implement Streams Admin APIs (#19049)
Implement Admin API extensions beyond list/describe group (delete group, offset-related APIs).

* adds methods for describing and manipulating offsets, as described in KIP-1071
* adds corresponding unit tests

These are doing the exact same thing as the corresponding consumer group counter-parts.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-03-05 15:32:09 +01:00
co63oc 3d7ac0c3d1
MINOR: Fix typos in multiple files (#19102)
Fix typos in multiple files

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-03-05 14:27:32 +00:00
S.Y. Wang 6ecf6817ad
KAFKA-18919 Clarify that KafkaPrincipalBuilder classes must also implement KafkaPrincipalSerde (#19104)
In KRaft mode, custom KafkaPrincipalBuilder instances must implement KafkaPrincipalSerde. This PR updates all related documentation to highlight this requirement.

Reviewers: Ken Huang <s7133700@gmail.com>, David Jacot <djacot@confluent.io>, TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-05 21:25:09 +08:00
Xuan-Zhang Gong 18eca0229d
KAFKA-18882 Remove BaseKey, TxnKey, and UnknownKey (#19054)
Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi <kitingiao@gmail.com>, PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-05 21:16:18 +08:00
Lan Ding 69ff5d1e70
KAFKA-18817: ShareGroupHeartbeat and ShareGroupDescribe API must check topic describe (#19083)
Reviewers: Christo Lolov <lolovc@amazon.com>
2025-03-05 11:25:08 +00:00
Kuan-Po Tseng cbd72cc216
KAFKA-14121: AlterPartitionReassignments API should allow callers to specify the option of preserving the replication factor (#18983)
Reviewers: Christo Lolov <lolovc@amazon.com>, Chia-Ping Tsai <chia7712@gmail.com>, TengYao Chi <kitingiao@gmail.com>
2025-03-05 11:23:12 +00:00
Jhen-Yung Hsu c3a9b0fc84
KAFKA-18804 Remove slf4j warning when using tool script (#18918)
When running the tools from source code, multiple SLF4J bindings are encountered. This is because both the tool and core modules' dependent libraries contain Log4j2 JARs. To eliminate these warnings, this PR removes the Log4j2 JARs from core's dependent libraries.

Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-05 17:29:00 +08:00
mingdaoy 0b6a42d437
KAFKA-18876: 4.0 docs follow-up (#19103)
https://github.com/apache/kafka/pull/19065#issuecomment-2698614575

Fixed:

![image](https://github.com/user-attachments/assets/2995f962-298f-4a4c-8f52-0b0459fd3b00)

Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi <kitingiao@gmail.com>, David Jacot <djacot@confluent.io>
2025-03-05 01:06:26 -08:00
David Jacot 08a52c59c1
MINOR: Refactor GroupCoordinatorConfig (#19092)
We defined multiple `ConfigDef`s in `GroupCoordinatorConfig` in then we
merge them in a few places because we always use them together. Having
multiple `ConfigDef`s does not seem necessary to me. This patch changes
it to have just one.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-03-05 01:03:59 -08:00
dengziming 1bfa4cd17b
KAFKA-10864 Convert end txn marker schema to use auto-generated protocol (#9766)
1. Convert end txn marker schema to use auto-generated protocol`EndTxnMarker`
2. substitute `CURRENT_END_TXN_MARKER_VALUE_SIZE` with an`endTnxMarkerValueSize` method since the size is accumulated from `EndTxnMarker`.
3. add buffer to `EndTransactionMarker` to avoid twice compute from `serializeValue` and `endTnxMarkerValueSize`.
4. flexibleVersions is set to none.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-03-05 15:47:02 +08:00
Logan Zhu 011f256c86
KAFKA-18886 add behavior change of CreateTopicPolicy and AlterConfigPolicy to zk2kraft (#19087)
1. Updated JavaDoc to reflect that CreateTopicPolicy and AlterConfigPolicy run on the controller in KRaft mode.
2. Modified Behavioral Change Reference in the HTML docs to include this change.
3. add warning message to KafkaConfig if the config of broker node has policy configs 


Reviewers: TengYao Chi <kitingiao@gmail.com>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-05 15:15:03 +08:00
David Arthur 6677bf7b21
MINOR Auto-approve Pull Request Reviewed with ci-approved label (#19098)
The "pull_request_review" event has similar permissions to
"pull_request". Due to our repo config, we require approvals for
non-committer PRs. This patch allows the `ci-approved` label to approve
the "Pull Request Reviewed" workflow as well as the "CI" workflow.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-03-04 21:02:00 -05:00
Mahsa Seifikar da4a8f148d
MINOR: Fix grammar and clarity in zk2kraft.html (#19096)
This PR addresses minor grammar and clarity issues in zk2kraft.html doc.

Reviewers: TengYao Chi <kitingiao@gmail.com>, Colin P. McCabe <cmccabe@apache.org>
2025-03-04 10:18:53 -08:00
Kuan-Po Tseng be9c4a4fab
KAFKA-18422 add link of KIP-1124 to "rolling upgrade" section (#19097)
Add client upgrade documentation, for more information, please refer to https://cwiki.apache.org/confluence/x/y4kgF

Reviewers: TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-05 01:14:21 +08:00
Lucas Brutschy 295760d3eb
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:49:47 +01:00
mingdaoy 8533c43c9d
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:07 +08:00
co63oc e4ece37dbf
Fix typos in multiple files (#19086)
Fix typos in multiple files

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-03-04 16:05:51 +00:00
Apoorv Mittal c1fc59fc23
KAFKA-18918: Correcting releasing of locks on exception (#19091)
The PR corrects the way the locks are released on exception. As
`partitionsAcquired` can be a reference to `topicPartitionData`, hence
the locks should released prior clearing `partitionsAcquired`.

Reviewers: Abhinav Dixit <adixit@confluent.io>, Andrew Schofield <aschofield@confluent.io>
2025-03-04 16:04:45 +00:00
David Jacot c2014c02b1
MINOR: Small refactor in GroupMetadataManager (#19090)
The code in GroupMetadataManager to request metadata refresh got pretty
ugly with the addition of share and stream groups. It seems preferable
to put the method in the base class.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-03-04 07:07:18 -08:00
David Jacot 1df4a42b40
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 06:31:08 -08:00
Nick Guo 101e15bb1c
KAFKA-18867 add tests to describe topic configs with empty name (#19075)
Reviewers: TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-04 14:56:25 +08:00
David Arthur d51817699f
KAFKA-18500 Build PRs at HEAD commit (#18449)
The default checkout behavior for GitHub Actions is to use a special
merge ref which is equivalent to the base branch with the PR merged into
it. While this is crucial for checking compilation issues against trunk,
it significantly diminishes our ability to use any build caching.

This patch changes the JUnit test jobs to checkout the HEAD commit of the PR 
when building. The "Compile and Check" step still checks out the merge commit
so we can keep that level of validation.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-03 19:02:10 -05:00
Mahsa Seifikar 2154e55abf
MINOR: Prevent broker fencing by adjusting resendExponentialBackoff in BrokerLifecycleManager (#19061)
This PR reduces `maxInterval` for `resendExponentialBackoff` in
`BrokerLifecycleManager` class from `broker.session.timeout.ms` to half
of its value. Setting `maxInterval` to `broker.session.timeout.ms`
caused brokers to be fenced if a resend attempt occurred near the
timeout threshold, leading to unnecessary broker fencing.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2025-03-03 12:03:15 -08:00