Commit Graph

15343 Commits

Author SHA1 Message Date
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
David Jacot 29115d5931
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:17 +01:00
Apoorv Mittal a6c53d0c37
KAFKA-18878: Added share session cache and delayed share fetch metrics (KIP-1103) (#19059)
The PR implements the ShareSessionCache and DelayedShareFetchMetrics as
defined in KIP-1103.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-03-03 16:44:34 +00:00
Bruno Cadonna ff94c44e70
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 11:58:56 +01:00
DL1231 a24fedfba0
KAFKA-18817:[1/N] ShareGroupHeartbeat and ShareGroupDescribe API must check topic describe (#19055)
1、Client support for TopicAuthException in DescribeShareGroup and HB
path
2、ShareConsumerImpl#sendAcknowledgementsAndLeaveGroup swallow
TopicAuthorizationException and GroupAuthorizationException

Reviewers: ShivsundarR <shr@confluent.io>, Andrew Schofield <aschofield@confluent.io>
2025-03-03 09:49:37 +00:00
Bruno Cadonna 898dcd11ad
MINOR: Extract HeartbeatRequestState from heartbeat request managers (#19043)
The AbstractHeartbeatRequestManager and the
StreamsGroupHeartbeatRequestManager, both use the
HeartbeatRequestState to track the state of the heartbeat requests. Both
heartbeat request managers have an implementation of
HeartbeatRequestState as inner class.
To deduplicate code this commit extracts the HeartbeatRequestState so
that the same code can be used by both heartbeat request manager.

Reviewers: Kirk True <ktrue@confluent.io>, Chia-Ping Tsai
<chia7712@gmail.com>, Lucas Brutschy <lbrutschy@confluent.io>
2025-03-03 10:46:20 +01:00
Lucas Brutschy a04dd21f26
KAFKA-18613: Auto-creation of internal topics in streams group heartbeat (#18981)
Implements auto-topic creation when handling the streams group
heartbeat.

Inside KafkaApis, the handler for streamsGroupHeartbeat uses the result
of the streams group heartbeat inside the group coordinator to attempt
to create all missing internal topics using AutoTopicCreationManager.
CREATE TOPIC ACLs are checked. The unit tests class
AutoTopicCreationManagerTest is brought back (it was recently deleted
during a ZK removal PR), but testing only the kraft-related
functionality.

Reviewers: Bruno Cadonna <bruno@confluent.io>

### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation 
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
2025-03-03 08:48:00 +01:00
Logan Zhu bf660fdeb6
KAFKA-18881 Document the ConsumerRecord as non-thread safe (#19056)
There are 3 issues (at least) about the multithreaded issue on ConsumerRecords. Hence, it would be better to document it completely. 

Reviewers: Kirk True <ktrue@confluent.io>, TengYao Chi <kitingiao@gmail.com>, Ken Huang <s7133700@gmail.com>, Xuan-Zhang Gong <gongxuanzhangmelt@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-03 13:03:36 +08:00
Janindu Pathirana 2e6e5304c0
KAFKA-18168: Adding checkpointing for GlobalKTable during restoration and closing (#18752)
To address the issue of not creating a checkpoint file during the
restoring and closing process, called the
GlobalStateUpdateTask.flushState() method in
GlobalStateUpdateTask.initialize() and GlobalStateUpdateTask.close()
methods. This will flush the state and create a checkpoint file thereby,
avoiding the need to completely restore the entire state.

Reviewers: Alieh Saeedi <asaeedi@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2025-03-02 12:16:48 -08:00
ClarkChen 42a200bd39
KAFKA-18907 Add suitable error message when the appended value is too larger (#19070)
In ZooKeeper mode, users can append configurations to create values larger than Short.MAX_VALUE. However, this behavior is disallowed in KRaft mode. Additionally, a server error is returned to users. Creating a value this large is rare, so we don't plan to fix it for KRaft. This PR aims to tweak the error message.

Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-03 03:23:01 +08:00
TengYao Chi d460efb9c9
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:00:41 +08:00
Xuan-Zhang Gong ceac4f0a1d
KAFKA-18880 Remove kafka.cluster.Broker and BrokerEndPointNotAvailableException (#19047)
Remove kafka.cluster.Broker and BrokerEndPointNotAvailableException as they were used by zk path.

Reviewers: TengYao Chi <kitingiao@gmail.com>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-02 10:54:32 +08:00
Sanskar Jhajharia 3c73c9bdc1
MINOR: Clean up group-coordinator (#19008)
Given that now we support Java 17 on our brokers, this PR replace the
use of :
- `Collections.singletonList()` and `Collections.emptyList()` with
`List.of()`
- `Collections.singletonMap()` and `Collections.emptyMap()` with
`Map.of()`
- `Collections.singleton()` and `Collections.emptySet()` with `Set.of()`

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-03-02 10:45:44 +08:00
TengYao Chi e0c77140b2
KAFKA-17039 KIP-919 supports for unregisterBroker (#19063)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-03-01 23:55:35 +08:00
Logan Zhu 2ccc73783e
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:37:35 +08:00
Nick Guo 98bb79e732
KAFKA-17981 add Integration test for ConfigCommand to add config `key=[val1,val2]` (#17771)
Reviewers: Jhen-Yung Hsu <jhenyunghsu@gmail.com>, TaiJuWu <tjwu1217@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-01 13:15:25 +08:00
mingdaoy 06b7d2e045
MINOR: Add flaky-related commands to README.md (#19025)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-01 11:17:38 +08:00
Xuan-Zhang Gong 45f932819e
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-02-28 13:24:24 -08:00
Apoorv Mittal 8cf969e00a
KAFKA-18734: Implemented share partition metrics (KIP-1103) (#19045)
The PR implements the SharePartitionMetrics as defined in KIP-1103, with
one change. The metric `FetchLockRatio` is defined as `Meter` in KIP but
is implemented as `HIstogram`. There was a discussion about same on
KIP-1103 discussion where we thought that `FetchLockRatio` is
pre-aggregated but while implemeting the rate from `Meter` can go above
100 as `Meter` defines rate per time period. Hence it makes more sense
to implement metric `FetchLockRatio` as `Histogram`.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-02-28 14:22:27 +00:00
Apoorv Mittal 8b605bd362
MINOR: Removing share partition manager flaky annotation (#19053)
There isn't any flaky test for SharePartitionManager in last 7 days, removing flaky annotation.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-02-28 08:49:59 +00:00
Calvin Liu f6ec7df27e
MINOR: correct an ELR test name in ActivationRecordsGeneratorTest (#19044)
`testActivationMessageForEmptyLogAtMv3_6WithTransactionAndElr` is tested
with 4.0IV1, so the name should be corrected.

Reviewers: Jun Rao <junrao@apache.org>
2025-02-27 14:47:56 -08:00
TengYao Chi e2d9ced098
KAFKA-18860 Remove Missing Features section (#19048)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-28 06:38:56 +08:00