Commit Graph

15956 Commits

Author SHA1 Message Date
lucliu1108 1d4b22bc3e MINOR: Improve Kafka Streams Protocol Upgrade Doc (#20241)
CI / build (push) Has been cancelled Details
As a follow-up minor addition to PR for
[KSTREAMS-7735](https://confluentinc.atlassian.net/browse/KSTREAMS-7735
) (https://github.com/apache/kafka/pull/20029) , add the instructions
for upgrading `streams.version` parameter for KIP-1071 EA.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-07-26 10:33:48 +01:00
Tsung-Han Ho (Miles Ho) d5a3acda89 KAFKA-19501 Update OpenJDK base image from buster to bullseye (#20165)
CI / build (push) Has been cancelled Details
The changes update the OpenJDK base image from 17-buster to 17-bullseye:
- Updates tests/docker/Dockerfile to use openjdk:17-bullseye instead of
openjdk:17-buster
  - Updates tests/docker/ducker-ak script to use the new default image
- Updates documentation in tests/README.md with the new image name
examples

Reviewers: Federico Valeri <fedevaleri@gmail.com>, TengYao Chi
<kitingiao@gmail.com>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai
<chia7712@gmail.com>
2025-07-22 16:25:53 +02:00
Mickael Maison e14d849cbf Bump version to 4.1.0
CI / build (push) Has been cancelled Details
2025-07-21 12:01:15 +02:00
Mickael Maison ca2409695d MINOR: Revert "Bump version to 4.1.0"
This reverts commit 57e81f2010.

This is an attempt at working around https://issues.apache.org/jira/browse/KAFKA-19528
2025-07-21 11:08:50 +02:00
Calvin Liu e4e2dce2eb KAFKA-19522: avoid electing fenced lastKnownLeader (#20200)
CI / build (push) Waiting to run Details
This patch fixes the bug that allows the last known leader to be elected as a partition leader while still in a fenced state, before the next heartbeat removes the fence.
https://issues.apache.org/jira/browse/KAFKA-19522

Reviewers: Jun Rao <junrao@gmail.com>, TengYao Chi
<frankvicky@apache.org>
2025-07-20 16:55:45 +08:00
Dmitry Werner 01d8154b6e KAFKA-19520 Bump Commons-Lang for CVE-2025-48924 (#20196)
CI / build (push) Waiting to run Details
Bump Commons-Lang for CVE-2025-48924.

Reviewers: Luke Chen <showuon@gmail.com>, Federico Valeri <fedevaleri@gmail.com>
2025-07-19 15:07:28 +08:00
Lucas Brutschy eb155a2113
MINOR: Revert "KAFKA-18913: Start state updater in task manager (#198… (#20186)
CI / build (push) Has been cancelled Details
This reverts commit 4d6cf3efef. It seemed
to trigger a race condition in the state updater initialization.

Reviewers: Bill Bejeck <bbejeck@apache.org>
2025-07-17 17:28:08 +02:00
Ming-Yen Chung 05f012c7f1 KAFKA-19427 Allow the coordinator to grow its buffer dynamically (#20040)
CI / build (push) Waiting to run Details
* Coordinator starts with a smaller buffer, which can grow as needed.

* In freeCurrentBatch, release the appropriate buffer:
  * The Coordinator recycles the expanded buffer
(`currentBatch.builder.buffer()`), not `currentBatch.buffer`, because
`MemoryBuilder` may allocate a new `ByteBuffer` if the existing one
isn't large enough.

  * There are two cases that buffer may exceeds `maxMessageSize`      1.
If there's a single record whose size exceeds `maxMessageSize` (which,
so far, is derived from `max.message.bytes`) and the write is in
`non-atomic` mode, it's still possible for the buffer to grow beyond
`maxMessageSize`. In this case, the Coordinator should revert to using a
smaller buffer afterward.      2. Coordinator do not recycles the buffer
that larger than `maxMessageSize`. If the user dynamically reduces
`maxMessageSize` to a value even smaller than `INITIAL_BUFFER_SIZE`, the
Coordinator should avoid recycling any buffer larger than
`maxMessageSize` so that Coordinator can allocate the smaller buffer in
the next round.

* Add tests to verify the above scenarios.

Reviewers: David Jacot <djacot@confluent.io>, Sean Quah
<squah@confluent.io>, Ken Huang <s7133700@gmail.com>, PoAn Yang
<payang@apache.org>, TaiJuWu <tjwu1217@gmail.com>, Jhen-Yung Hsu
<jhenyunghsu@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-07-17 00:54:34 +08:00
Calvin Liu 98cb8df7a5
MINOR: Bump LATEST_PRODUCTION to 4.1IV1 and Use MV to enable ELR (#20174)
CI / build (push) Waiting to run Details
Removing the isEligibleLeaderReplicasV1Enabled to let ELR be enabled if
MV is at least 4.1IV1. Also bump the Latest Prod MV to 4.1IV1

Reviewers: Jun Rao <junrao@gmail.com>
2025-07-15 20:23:53 -07:00
Bill Bejeck f35f94b3e6 KAFKA-19504: Remove unused metrics reporter initialization in KafkaAdminClient (#20166)
CI / build (push) Has been cancelled Details
The `AdminClient` adds a telemetry reporter to the metrics reporters
list in the constructor.  The problem is that the reporter was already
added in the `createInternal` method.  In the `createInternal` method
call, the `clientTelemetryReporter` is added to a
`List<MetricReporters>` which is passed to the `Metrics` object, will
get closed when `Metrics.close()` is called.  But adding a reporter to
the reporters list in the constructor is not used by the `Metrics`
object and hence doesn't get closed, causing a memory leak.

All related tests pass after this change.

Reviewers: Apoorv Mittal <apoorvmittal10@apache.org>, Matthias J. Sax
 <matthias@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>,
 Jhen-Yung Hsu <jhenyunghsu@gmail.com>
2025-07-14 20:21:12 -04:00
Luke Chen 793294bd2e
KAFKA-19495: Update config for native image (v4.1.0) (#20151)
CI / build (push) Has been cancelled Details
Backport of https://github.com/apache/kafka/pull/20150

Reviewers: Mickael Maison <mickael.maison@gmail.com>, TengYao Chi <frankvicky@apache.org>
2025-07-11 14:38:52 +02:00
Mickael Maison d0a308e4f6 Merge tag '4.1.0-rc0' into 4.1
CI / build (push) Has been cancelled Details
4.1.0-rc0
2025-07-09 14:50:03 +02:00
Mickael Maison 610f076542 Bump version to 4.1.0 2025-07-09 14:50:03 +02:00
Mickael Maison 57e81f2010 Bump version to 4.1.0 2025-07-09 11:48:41 +02:00
José Armando García Sancio b0ff9ba161 KAFKA-19184: Add documentation for upgrading the kraft version (#20071)
CI / build (push) Waiting to run Details
Update the documentation to describe how to upgrade the kraft feature
version from 0 to 1.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Alyssa Huang
<ahuang@confluent.io>
2025-07-09 11:21:36 +02:00
Ismael Juma 487af011ca KAFKA-19444: Add back JoinGroup v0 & v1 (#20116)
CI / build (push) Has been cancelled Details
This fixes librdkafka older than the recently released 2.11.0 with
Kerberos authentication and Apache Kafka 4.x.

Even though this is a bug in librdkafka, a key goal of KIP-896 is not to
break the popular client libraries listed in it. Adding back JoinGroup
v0 & v1 is a very small change and worth it from that perspective.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-07-07 15:15:29 -07:00
Omnia Ibrahim e6b78ae9e5 KAFKA-19397: Ensure consistent metadata usage in produce request and response (#19964)
CI / build (push) Waiting to run Details
- Metadata doesn't have the full view of topicNames to ids during
rebootstrap of client or when topic has been deleted/recreated. The
solution is to pass down topic id and stop trying to figure it out later
in the logic.

---------

Co-authored-by: Kirk True <kirk@kirktrue.pro>
2025-07-07 19:52:15 +08:00
Ken Huang f14e60fc8f KAFKA-19042 Move ProducerSendWhileDeletionTest to client-integration-tests module (#19971)
Use Java to rewrite ProducerSendWhileDeletionTest by new test infra and
move it to client-integration-tests module.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-07-07 16:26:51 +08:00
Jhen-Yung Hsu b4875501e1
MINOR: Add 4.1 branch to CI (#20112)
Add 4.1 branch to CI per https://github.com/apache/kafka/pull/18215

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-07-07 16:15:16 +08:00
Sushant Mahajan 71f5600283
KAFKA-19453: Ignore group not found in share group record replay (#20100)
* When a `ShareGroup*` record is replayed in group metadata manager,
there is a call to check if the group exists. If the group does not
exist - we are throwing an exception which is unnecessary.
* In this PR, we have added check to ignore this exception.
* New test to validate the logic has been added.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>

Note: cherry pick from PR https://github.com/apache/kafka/pull/20076 in
trunk.
2025-07-03 19:46:59 +01:00
Sushant Mahajan d02028d773
MINOR: Code change to prevent NPE to due share delete. (#20092)
* The `GroupCoordinatorService.onPartitionsDeleted` code and
`GroupMetadataManager.shareGroupBuildPartitionDeleteRequest` code looks
up the metadata image to find topic name/partitions for topic ids.
* If the topic id is not present in the image, it will throw an NPE
resulting in crash.
* This PR aims to solve the issue.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-07-02 17:16:18 +01:00
Kirk True 38f9cf6188 KAFKA-19152: Add top-level documentation for OAuth flows (#20025)
Adds documentation to support the OAuth additions from KIP-768 and
KIP-1139.

The existing documentation is heavily geared toward Kafka's support for
non-production OAuth usage. Since this mode is still supported, it
should not be removed. However, with the addition of the production
OAuth usage, the documentation is less than succinct because it has a
bit of a split personality issue.
2025-07-01 12:41:10 +05:30
Lucas Brutschy 32c8cfa87f KAFKA-19379: Basic upgrade guide for KIP-1071 EA (#20029)
Basic documentation describing:   - That it's in EA now

 - What it does

 - What features are not yet supported

 - How to enable it / disable it

 - Any changes in the interfaces

          - kafka-streams-groups.sh

          - StreamsGroupDescribe

 - How to provide feedback

Reviewers: Andrew Schofield <aschofield@confluent.io>, Matthias J. Sax
 <matthias@confluent.io>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Matthias J. Sax <mjsax@apache.org>
2025-06-30 13:56:37 +02:00
Sean Quah b55c59a661 KAFKA-19445: Fix coordinator runtime metrics sharing sensors (#20062)
When sensors are shared between different metric groups, data from all
groups is combined and added to all metrics under each sensor. This
means that different metric groups will report the same values for their
metrics.

Prefix sensor names with metric group names to isolate metric groups.

Reviewers: Yung <yungyung7654321@gmail.com>, Sushant Mahajan
<smahajan@confluent.io>, Dongnuo Lyu <dlyu@confluent.io>, TengYao Chi
<frankvicky@apache.org>
# Conflicts:
#	coordinator-common/src/test/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntimeMetricsImplTest.java
2025-06-30 17:04:03 +08:00
Matthias J. Sax adfcc9ed3f MINOR: Improve ProcessorContext JavaDocs (#20042)
Clarify that state stores are sharded, and shards cannot be shared
across Processors.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-06-26 10:08:02 -07:00
David Jacot 7bdeb36a52 KAFKA-19246; OffsetFetch API does not return group level errors correctly with version 1 (#19704)
The OffsetFetch API does not support top level errors in version 1.
Hence, the top level error must be returned at the partition level.

Side note: It is a tad annoying that we create error response in
multiple places (e.g. KafkaApis, Group CoordinatorService). There were a
reason for this but I cannot remember.

Reviewers: Dongnuo Lyu <dlyu@confluent.io>, Sean Quah <squah@confluent.io>, Ken Huang <s7133700@gmail.com>, TengYao Chi <frankvicky@apache.org>
2025-06-26 15:30:44 +02:00
Ritika Reddy c4cac07819
KAFKA-19414: Remove 2PC public APIs from 4.1 until release (KIP-939) (#19985)
We are removing some of the previously added public APIs until KIP-939
is ready to use.

Reviewers: Justine Olshan <jolshan@confluent.io>
2025-06-25 09:06:21 -07:00
Lucas Brutschy aa0d1f5000 MINOR: Reject requests using unsupported features in KIP-1071 (#20031)
KIP-1071 does not currently support all features planned in the KIP. We
should reject any requests that are using features that are currently
not implemented.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Matthias J. Sax
 <matthias@confluent.io>, Bill Bejeck <bill@confluent.io>
2025-06-25 14:49:53 +02:00
Rajini Sivaram 85f9e93933 MINOR: Fix response for consumer group describe with empty group id (#20030)
ConsumerGroupDescribe with an empty group id returns a response containing `null` groupId in a non-nullable field. Since the response cannot be serialized, this results in UNKNOWN_SERVER_ERROR being returned to the client. This PR sets the group id in the response to an empty string instead and adds request tests for empty group id.

Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2025-06-25 10:50:43 +01:00
Matthias J. Sax fb054b590e KAFKA-19398: (De)Register oldest-iterator-open-since-ms metric dynamically (#20022)
The metric for oldest-iterator-open-since-ms might report a null value
if there is not open iterator.

This PR changes the behavior to dynamically register/deregister the
entire metric instead of allowing it to return a null value.

Reviewers: Bill Bejeck <bbejeck@apache.org>
2025-06-24 17:21:53 -07:00
Calvin Liu b80aa15c17
KAFKA-19383: Handle the deleted topics when applying ClearElrRecord (#20033)
https://issues.apache.org/jira/browse/KAFKA-19383 When applying the
ClearElrRecord, it may pick up the topicId in the image without checking
if the topic has been deleted. This can cause the creation of a new
TopicRecord with an old topic ID.

Reviewers: Alyssa Huang <ahuang@confluent.io>, Artem Livshits <alivshits@confluent.io>, Colin P. McCabe <cmccabe@apache.org>

No conflicts.
2025-06-24 17:04:45 -07:00
Colin Patrick McCabe 87c83c08ac KAFKA-19294: Fix BrokerLifecycleManager RPC timeouts (#19745)
Previously, we could wait for up to half of the broker session timeout
for an RPC to complete, and then delay by up to half of the broker
session timeout. When taken together, these two delays could lead to
brokers erroneously missing heartbeats.

This change removes exponential backoff for heartbeats sent from the
broker to the controller. The load caused by heartbeats is not heavy,
and controllers can easily time out heartbeats when the queue length is
too long. Additionally, we now set the maximum RPC time to the length of
the broker period. This minimizes the impact of heavy load.

Reviewers: José Armando García Sancio <jsancio@apache.org>, David Arthur <mumrah@gmail.com>
2025-06-24 16:30:31 -07:00
Alyssa Huang 3f0ae7fd53 KAFKA-19411: Fix deleteAcls bug which allows more deletions than max records per user op (#19974)
If there are more deletion filters after we initially hit the
`MAX_RECORDS_PER_USER_OP` bound, we will add an additional deletion
record ontop of that for each additional filter.

The current error message returned to the client is not useful either,
adding logic so client doesn't just get `UNKNOWN_SERVER_EXCEPTION` with
no details returned.
2025-06-24 15:51:30 -07:00
Bill Bejeck 019ab2cb11
MINOR: Revert initial transactional state store semantics commit (#19956)
Reverts #16922 and #18732 of incomplete feature.

PRs #16922 and #18732 are part of
[KIP-1035](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1035%3A+StateStore+managed+changelog+offsets).
In particular,
on starting a Kafka Streams instance, if it has pre-existing state, the
state stores are initialized on the main thread.  Part of this
initialization registers the stateful metrics with the JMX thread-id tag
of `main`.  This breaks the KIP-1076 implementation where need to
register metrics with thread-id tags of `xxxStreamThread-N`.  This is
necessary due to the fact that the `StreamsMetric` is a singleton shared
by all `StreamThread` instances, so we need to make sure only add
metrics for the current `StreamThread` otherwise duplicate metrics are
registered. This PR reverts the changes until a fix is implemented,
allowing the individual  `StreamThread`s to register the metrics.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-06-24 17:31:25 -04:00
Lan Ding 75ab2f5d03 MINOR: fix reassign command bug (#20003)
see

9570c67b8c/core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala (L1208)
During the rewrite for
[KAFKA-14595](https://github.com/apache/kafka/pull/13247), the relevant
condition was omitted.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-06-25 02:35:20 +08:00
Okada Haruki 1dad77615d KAFKA-19407 Fix potential IllegalStateException when appending to timeIndex (#19972)
## Summary
- Fix potential race condition in
LogSegment#readMaxTimestampAndOffsetSoFar(), which may result in
non-monotonic offsets and causes replication to stop.
- See https://issues.apache.org/jira/browse/KAFKA-19407 for the details
how it happen.

Reviewers: Vincent PÉRICART <mauhiz@gmail.com>, Jun Rao
 <junrao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-06-25 00:40:27 +08:00
Apoorv Mittal 802431901a
MINOR: Correcting exception codes in Share Partition (#20028)
The PR cherrypicks below commit:

```
commit 1ca8779bee
Author: Apoorv Mittal <apoorvmittal10@gmail.com>
Date:   Tue Jun 24 09:46:14 2025 +0100

    MINOR: Correcting client error for fenced share partition (#20023)

    Correct the error when SharePartition is fenced.

    Reviewers: Abhinav Dixit <adixit@confluent.io>, Sushant Mahajan
     <smahajan@confluent.io>, Andrew Schofield <aschofield@confluent.io>
```

And selective changes from following commit, which are critical:

```
commit 3d4407ff9d
Author: Sushant Mahajan <smahajan@confluent.io>
Date:   Mon Jun 23 23:57:15 2025 +0530

    MINOR: Change exceptions for few error codes in SharePartition.
(#20020)

    * The `SharePartition` class wraps the errors received from
`PersisterStateManager` to be sent to the client.      * In this PR, we
are categorizing the errors a bit better.      * Some exception messages
in `PersisterStateManager` have been updated      to show the share
partition key.      * Tests have been updated wherever needed.

    Reviewers: Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal
<apoorvmittal10@gmail.com>
```

Reviewers: Andrew Schofield <aschofield@confluent.io>, Sushant Mahajan
 <smahajan@confluent.io>
2025-06-24 12:46:27 +01:00
Sushant Mahajan 4c63711971 MINOR: Invoke share group rebalance sensor. (#20006)
* The share group rebalance metric was not being invoked at the
appropriate group id bump position.
* This PR solves the issue.
* The metric name has been updated
(s/rebalance-rate/share-group-rebalance-rate,
s/rebalance-count/share-group-rebalance-count/)
* Updated tests in `GroupMetadataManagerTest` and
`GroupCoordinatorMetricsTest`

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-06-24 10:03:18 +01:00
Lucas Brutschy c0b5fcf843 KAFKA-19429: Deflake streams_smoke_test (#20019)
It looks like we are checking for properties that are not guaranteed
under at_least_once, for example, exact counting (not allowing for
overcounting).

This change relaxes the validation constraint to only check that we
counted _at least_ N messages, and our sums come out as _at least_ the
expected sum.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-06-23 20:17:35 +02:00
Lucas Brutschy b41c4f6b57 KAFKA-19421: Deflake streams_broker_down_resilience_test (#19999)
`streams_broker_down_resilience_test` produce messages with `null` key
to a topic with three partitions and expect each partition to be
non-empty afterward. But I don't think this is a correct assumption, as
a producer may try to be sticky and only produce to two partitions.

This cause occasional flakiness in the test.

The fix is to produce records with keys.

Reviewers: Matthias J. Sax <matthias@confluent.io>, PoAn Yang
 <payang@apache.org>
2025-06-23 17:45:06 +02:00
Lucas Brutschy 5f1623adec KAFKA-19422: Deflake streams_application_upgrade_test (#20004)
In this upgrade test, applications sometimes crash before the upgrade,
so it's actually triggering a bug in several older versions (2.x and
possibly others). It seems to be a rare race condition that has been
happening since 2022. Since we are not going to roll out a patch release
for Kafka Streams 2.x, we should just allow applications to crash before
the upgrade.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-06-23 17:45:01 +02:00
Sushant Mahajan 150412d7f7
MINOR: Change snapshot epoch type to int32 in schema. (#20016) (#20018)
* `SnapshotEpoch` type in `ShareSnapshotValue.json` and
`ShareUpdateValue.json` is currently
`uint16` which might overflow under heavy traffic.
* To be consistent with other epochs, this PR updates the type to
`int32`.

backport from trunk (cb809e2574)

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-06-23 14:23:06 +01:00
Sushant Mahajan 7b6ef4d322
MINOR: Add retention prop to share group state topic. (#20013) (#20015)
* https://cwiki.apache.org/confluence/display/KAFKA/KIP-932%3A+Queues+for+Kafka
states the `retention.ms` property for the `__share_group_state` to be
`-1`.
* This PR makes it explicit when defining the values of those configs.
* Existing test has been updated.

```
$ bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe
--topic __share_group_state

Topic: __share_group_state      TopicId: XCwzZjEGSjm5lUc_BeCrqA
PartitionCount: 50      ReplicationFactor: 1
Configs:
compression.type=producer,
min.insync.replicas=1,
cleanup.policy=delete,
segment.bytes=104857600,
retention.ms=-1
...
```

Cherry-pick from trunk (56a6ba2d2e)

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-06-23 08:31:59 +01:00
Lucas Brutschy af3d5a1e24 KAFKA-19423: Deflake streams_broker_bounce_test (#20005)
The test is resizing the `__consumer_offset` topic after broker start.
This seems to be completely unsupported. The group coordinator fetches
the number of partitions for the consumer offset topic once and never
updates it. So we can be in a state where two brokers have a different
understanding of how `__consumer_offsets` are partitioned.

The result in this test can be that two group coordinators both think
they own a certain group. The test is resizing `__consumer_offsets`
right after start-up from 3 to 50. Before the broker bounce, the GC
operates on only three partitions (0-2). During the bounce, we get new
brokers that operate on (0-49). This means that two brokers can both
think, at the same time, that they own a group.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-06-20 11:29:26 -07:00
Lianet Magrans 38652f763d KAFKA-19356: Prevent new consumer fetch assigned partitions not in explicit subscription (#19983)
Fix to ensure assigned partitions whose topics are not in the consumer
explicit subscription are considered not fetchable (so that no records
are returned on poll for them)

This scenario could happen in the new async consumer (using the Consumer
rebalance protocol) when the subscription changes, because the consumer
will keep its assignment until the coordinator sends a new one (broker
drives assignments).

This does not happen in the classic consumer because the assignment
logic lives on the client-side, so the consumer pro-actively updates
assignment as needed.

This PR validates assignment vs subscription on fetch for explicit
subscription  only. Regular expressions, shared subscription  remain
unchanged (regex case still under discussion, will be handled separately
if needed)

Reviewers: Andrew Schofield <aschofield@confluent.io>, TengYao Chi
 <frankvicky@apache.org>, Kirk True <ktrue@confluent.io>, Jhen-Yung Hsu
 <jhenyunghsu@gmail.com>
2025-06-18 18:39:06 -04:00
Kirk True 198389663e KAFKA-19297: Refactor AsyncKafkaConsumer's use of Java Streams APIs in critical sections (#19917)
Profiling has shown that using the Collections Streams API approach adds
unnecessary overhead compared to a traditional for loop. Minor revisions
to the code have been made to use simpler constructs to improve
performance.

Reviewers: Lianet Magrans <lmagrans@confluent.io>, Andrew Schofield
 <aschofield@confluent.io>
2025-06-18 10:01:33 -04:00
Lucas Brutschy 0f9ed78754 KAFKA-19413: Extended AuthorizerIntegrationTest to cover StreamsGroupDescribe (#19981)
Extending test coverage of authorization for streams group RPC
StreamsGroupDescribe. The RPC requires DESCRIBE GROUP and DESCRIBE TOPIC
permissions for all topics.

Reviewers: Bill Bejeck <bbejeck@apache.org>
2025-06-18 10:20:18 +02:00
Lucas Brutschy e246f46b75 KAFKA-19412: Extended AuthorizerIntegrationTest to cover StreamsGroupHeartbeat (#19978)
Extending test coverage of authorization for streams group RPC
StreamsGroupHeartbeat. The RPC requires READ GROUP and DESCRIBE TOPIC
permissions for all topics. For creating internal topics, we require
CREATE TOPIC permission. If internal topic  creation fails, the request
does not fail, but the status reflects this problem.

Reviewers: Bill Bejeck <bbejeck@apache.org>
2025-06-18 10:08:06 +02:00
Lucas Brutschy 8c4224057d MINOR: Add entity types in streams group RPCs (#19979)
These can be used to implement transformations on top of the RPC
definitions. Group IDs were already marked. This PR additionally adds
the entityType for all topic names.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-06-18 09:16:02 +02:00
Ritika Reddy e9871efef8 KAFKA-19367: Follow up bug fix (#19976)
This is a follow up to [https://github.com/apache/kafka/pull/19910](url)
`The coordinator failed to write an epoch fence transition for producer
jt142 to the transaction log with error COORDINATOR_NOT_AVAILABLE. The
epoch was increased to 2 but not returned to the client
(kafka.coordinator.transaction.TransactionCoordinator)` -- as we don't
bump the epoch with this change, we should also update the message to
not say "increased" and remove the
**epochAndMetadata.transactionMetadata.hasFailedEpochFence = true** line

In the test, the expected behavior is:
1) First append transaction to the log fails with
COORDINATOR_NOT_AVAILABLE (epoch 1)
2) We try init_pid again, this time the SINGLE epoch bump succeeds, and
the following things happen simultaneously (epoch 2)
     -> Transition to COMPLETE_ABORT
     -> Return CONCURRENT_TRANSACTION error to the client
3) The client retries, and there is another epoch bump; state
transitions to EMPTY (epoch 3)

Reviewers: Justine Olshan <jolshan@confluent.io>, Artem Livshits
 <alivshits@confluent.io>
2025-06-17 15:11:31 -07:00