Commit Graph

15774 Commits

Author SHA1 Message Date
Yunchi Pang 5c3d7512de
MINOR: suppress removal warnings for listClientMetricsResources (#19787)
CI / build (push) Waiting to run Details
suppress removal warnings for `listClientMetricsResources`

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-05-23 04:07:14 +08:00
Ken Huang aacf3a4b3d
KAFKA-19042 Move PlaintextConsumerPollTest to client-integration-tests module (#19582)
Use Java to rewrite PlaintextConsumerPollTest by new test infra and move
it to client-integration-tests module.

Reviewers: PoAn Yang <payang@apache.org>, TengYao Chi
<kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-05-23 04:01:51 +08:00
Jing-Jia Hung bc797b077f
KAFKA-19314 Remove unnecessary code of closing snapshotWriter (#19763)
- Remove redundant close of `snapshotWriter`.
- `snapshotWriter` is already closed by `RaftSnapshotWriter#writer`.

Reviewers: Jhen-Yung Hsu <jhenyunghsu@gmail.com>, Ken Huang
 <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-05-23 03:57:14 +08:00
Ming-Yen Chung 21afc83f8e
HOTFIX: Fix testDeleteConsumerGroupOffsets (#19788)
Fix the change in
https://github.com/apache/kafka/pull/19380/files#r2102980872

Use `LinkedHashMap` instead of `Set` to  preserve the order of elements.

Reviewers: Jhen-Yung Hsu <jhenyunghsu@gmail.com>, Sanskar Jhajharia
 <sjhajharia@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2025-05-23 03:45:04 +08:00
Gaurav Narula 8f849f91f1
MINOR: Update Scala to v2.13.16 to support Java 24 (#19782)
Refer

https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html#scala-compatibility-table

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-05-23 00:54:51 +08:00
PoAn Yang 30d7c71f09
KAFKA-18904: Add Admin#listConfigResources [2/N] (#19743)
CI / build (push) Waiting to run Details
* Add new functions `listConfigResources(Set<ConfigResource.Type>
configResourceTypes, ListConfigResourcesOptions options)` and
`listConfigResources()` to `Admin` interface.
  * New functions can list all kind of config resource types.
  * If input is a set with a type other than `CLIENT_METRICS` and
request version is 0, return `UnsupportedVersionException`.
* Deprecate functions
`listClientMetricsResources(ListClientMetricsResourcesOptions options)`
and `listClientMetricsResources()`.
* Deprecate classes `ListClientMetricsResourcesResult` and
`ClientMetricsResourceListing`.
* Change `ClientMetricsCommand` to use `listConfigResources`.
* Add integration tests to `PlaintextAdminIntegrationTest.java`.
* Add unit tests to `KafkaAdminClientTest.java`.

Reviewers: Andrew Schofield <aschofield@confluent.io>

---------

Signed-off-by: PoAn Yang <payang@apache.org>
2025-05-22 16:05:35 +01:00
Abhinav Dixit 239dce3e04
KAFKA-19291: Increase the timeout of remote storage share fetch requests in purgatory (#19757)
CI / build (push) Waiting to run Details
### About
Consumer groups have a different timeout `REMOTE_FETCH_MAX_WAIT_MS_PROP`
in delayed fetch purgatory for fetch requests having remote storage
fetch ([code

link](https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/server/ReplicaManager.scala#L1669)).
This is done before the request enters the purgatory, so its easy to
change. At the moment share groups can only have a `waitTimeMs` `of
shareFetch.fetchParams().maxWaitMs` (default value `500ms`) for delayed
share fetch purgatory regardless of whether they are remote
storage/local log fetch.
This PR introduces a way to increase the timeout of remote storage fetch
requests if a remote storage fetch request couldn't complete within
`shareFetch.fetchParams().maxWaitMs`, then we create a timer task which
can be interrupted whenever `pendingFetches` is finished. The change has
been done to avoid the expiration of remote storage share fetch
requests.

### Testing
The code has been tested with the help of unit tests and
`LocalTieredStorage.java`

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>
2025-05-22 07:41:33 +01:00
lorcan e88c10d595
KAFKA-4650: Add unit tests for GraphNode class (#18951)
CI / build (push) Waiting to run Details
Unit tests added for the class GraphNode.

Change applied to GraphNode parentNodes() function to return a copy of
the collection, which is consistent with how the children() collection
is returned.

Reviewers: Bill Bejeck <bbejeck@apache.org>

---------

Co-authored-by: Lorcan <lorcanjames1@gmail.com>
2025-05-21 08:58:24 -04:00
Bolin Lin 388db49191
KAFKA-19287 document all group coordinator metrics (#19749)
add following metrics

1.
kafka.server:type=group-coordinator-metrics,name=event-queue-time-ms-p95
2.

kafka.server:type=group-coordinator-metrics,name=num-partitions,state=[loading|active|failed]
3.

kafka.server:type=group-coordinator-metrics,name=event-processing-time-ms-p95
4.

kafka.server:type=group-coordinator-metrics,name=event-purgatory-time-ms-p95
5.
kafka.server:type=group-coordinator-metrics,name=batch-flush-time-ms-p95

Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai
 <chia7712@gmail.com>
2025-05-21 19:15:07 +08:00
Sanskar Jhajharia c9fcad7e86
MINOR: Cleanup Core Module- Scala Modules (1/n) (#19380)
Now that Kafka Brokers support Java 17, this PR makes some changes in
core module. The changes in this PR are limited to only the Scala files
in the Core module's tests. The unit tests module is still pending. It
shall follow next.  The changes mostly include:

- Collections.emptyList(), Collections.singletonList() and
Arrays.asList() are replaced with List.of()
- Collections.emptyMap() and Collections.singletonMap() are replaced
with Map.of()
- Collections.singleton() is replaced with Set.of()

To be clear, the directories being targeted in this PR are:
- core/src/test/scala/kafka
- core/src/test/scala/integration/kafka

Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai
<chia7712@gmail.com>
2025-05-21 16:10:19 +08:00
Ken Huang 95d31befef
MINOR: update the gradle version for java 24 support (#19760)
Gradle 8.14 starts to support Java 24, so we should update the Gradle
version accordingly.

Reviewers: TengYao Chi <kitingiao@gmail.com>, PoAn Yang
<payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-05-21 15:10:56 +08:00
TengYao Chi af11146bc9
MINOR: Add more description to KIP-1148 (#19768)
Given that we will remove the `log.cleaner.enable`, the related config
`log.cleaner.threads` will also have the respective adjustment.  This
patch will add a description to it.

For more details:

https://issues.apache.org/jira/browse/KAFKA-13610?focusedCommentId=17950756&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17950756

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-05-21 14:58:55 +08:00
Luke Chen f314497b63
MINOR: add 3.9.1 to system tests (#19772)
CI / build (push) Waiting to run Details
Add 3.9.1 to system tests following this release guide:

https://cwiki.apache.org/confluence/display/KAFKA/Release+Process#ReleaseProcess-Afterrelease

Reviewers: TengYao Chi <frankvicky@apache.org>
2025-05-21 14:09:00 +08:00
Sanskar Jhajharia 9711caca41
MINOR: Cleanup Shell Module (#19771)
Now that Kafka supports Java 17, this PR updates the shell module to get
rid of older code. The changes mostly include:
- Collections.emptyList(), Collections.singletonList() and
- Arrays.asList() are replaced with List.of()
- Replace switch statement with switch expression

Reviewers: PoAn Yang <payang@apache.org>, Yung
<yungyung7654321@gmail.com>, Ken Huang <s7133700@gmail.com>, TengYao Chi
<frankvicky@apache.org>
2025-05-21 12:47:45 +08:00
Kaushik Raina 896f283e1e
KAFKA-18783 : Extend InvalidConfigurationException related exceptions (#19731)
## Summary
Extend InvalidConfigurationException related exceptions
  - `AuthenticationException`
  - `AuthorizationException`
  - `ClusterAuthorizationException`
  - `TransactionalIdAuthorizationException`
  - `UnsupportedVersionException`
  - `UnsupportedForMessageFormatException`
  - `InvalidRecordException`
  - `InvalidRequiredAcksException`
  - `RecordBatchTooLargeException`
  - `InvalidTopicException`
  - `TopicAuthorizationException`
  - `GroupAuthorizationException`

## Testing
- Added unit tests in `TransactionExceptionHierarchyTest` to verify:
  - All configuration-related exceptions properly extend
`InvalidConfigurationException`

Reviewers: Justine Olshan <jolshan@confluent.io>
2025-05-20 16:31:33 -07:00
Ritika Reddy 37fdbb3575
MINOR:- Edit test in transaction command (#19746)
CI / build (push) Waiting to run Details
The test incorrectly used force-terminate instead of
forceTerminateTransaction

Reviewers: Justine Olshan <jolshan@confuent.io>, Kuan-Po Tseng
 <brandboat@gmail.com>, Ken Huang <s7133700@gmail.com>
2025-05-20 10:23:38 -07:00
Andy Li 38f3b2835d
MINOR: API Responses missing latest version in Kafka protocol guide (#19769)
### Issue: 

API Responses missing latest version in [Kafka protocol
guide](https://kafka.apache.org/protocol.html)

#### For example:

These are missing:

- ApiVersions Response (Version: 4) — Only versions 0–3 are documented,
though version 4 of the request is included.

- DescribeTopicPartitions Response — Not listed at all.

- Fetch Response (Version: 17) — Only versions 4–16 are documented,
though version 17 of the request is included.

#### After the fix:

docs/generated/protocol_messages.html

<img width="1045" alt="image"
src="https://github.com/user-attachments/assets/5ea79ced-aab5-4c47-8e09-9956047c9bf1"
/>

Reviewers: dengziming <dengziming1993@gmail.com>, Ken Huang
<s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-05-21 00:26:51 +08:00
Sanskar Jhajharia 9f293866ab
MINOR: Cleanup Share Coordinator (#19770)
CI / build (push) Waiting to run Details
Now that Kafka Brokers support Java 17, this PR updates the share
coordinator module to get rid of older code. The changes mostly include:
- Collections.emptyList(), Collections.singletonList() and
- Arrays.asList() are replaced with List.of()
- Collections.emptyMap() and Collections.singletonMap() are replaced
with Map.of()
- Collections.singleton() is replaced with Set.of()

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-05-20 12:33:20 +01:00
TengYao Chi d3f8979486
MINOR: Update the supported tags in docker_scan.yml (#19766)
CI / build (push) Waiting to run Details
The 3.9.1-rc2 has been accepted as the new release. Hence, we should
update the supported tags.

Reviewers: Luke Chen <showuon@gmail.com>
2025-05-20 11:21:27 +08:00
PoAn Yang cff10e6541
KAFKA-19302 Move ReplicaState and Replica to server module (#19755)
CI / build (push) Waiting to run Details
1. Move `ReplicaState` and `Replica` to server module.
2. Rewrite `ReplicaState` and `Replica` in Java.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-05-19 23:59:12 +08:00
Ken Huang 6573b4ace1
KAFKA-19042 Move PlaintextConsumerCommitTest to client-integration-tests module (#19389)
Use Java to rewrite `PlaintextConsumerCommitTest` by new test infra and
move it to client-integration-tests module.

Reviewers: PoAn Yang <payang@apache.org>, Chia-Ping Tsai
<chia7712@gmail.com>
2025-05-19 21:51:42 +08:00
PoAn Yang c493d89334
KAFKA-17747: [3/N] Get rid of TopicMetadata in SubscribedTopicDescriberImpl (#19611)
CI / build (push) Waiting to run Details
Replace `TopicMetadata` with `MetadataImage` in
`SubscribedTopicDescriberImpl` and  `TargetAssignmentBuilder`.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot
 <djacot@confluent.io>
2025-05-19 20:46:24 +08:00
Hong-Yi Chen ce4940f989
MINOR: Refactor shared-group request handle methods to return CompletableFuture for consistent error handling (#19724)
CI / build (push) Waiting to run Details
This PR is based on the discussion here:
https://github.com/apache/kafka/pull/18929#discussion_r2083238645

Currently, the handle methods related to `shared‐group` requests  are
inconsistent: some return `Unit` while others return
`CompletableFuture[Unit]` without a clear rationale. This PR
standardizes all of them to return `CompletableFuture[Unit]` and ensures
consistent error handling by chaining `.exceptionally(handleError)` to
each call site.

Reviewers: PoAn Yang <payang@apache.org>, Ken Huang
 <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-05-19 01:45:50 +08:00
Yunchi Pang 6596ba3a78
MINOR: Remove unnecessary test conditions where ListOffsetsRequest version is 0 (#19738)
Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi
<kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-05-19 00:20:24 +08:00
Lucas Brutschy f26974b16d
KAFKA-19202: Enable KIP-1071 in streams_eos_test (#19700)
CI / build (push) Waiting to run Details
Enable next system test with KIP-1071.

Some of the validation inside the test did not make sense for KIP-1071.
This is because in KIP-1071, if a member leaves or joins the group, not
all members may enter a REBALANCING state. We use the wrapper introduced
in   [KAFKA-19271](https://issues.apache.org/jira/browse/KAFKA-19271)
to print a log line whenever the member epoch is bumped, which is  the
only way a member can "indirectly" observe that other members  are
rebalancing.

Reviewers: Bill Bejeck <bill@confluent.io>
2025-05-17 21:20:47 +02:00
Lucas Brutschy bff1602df3
KAFKA-19280: Fix NoSuchElementException in UnifiedLog (#19717)
In FETCH requests and TXN_OFFSET_COMMIT requests, on current trunk we
run into a race condition inside UnifiedLog, causing a
`NoSuchElementException` in
`UnifiedLog.fetchLastStableOffsetMetadata(UnifiedLog.java:651)`.

The cause is that the line a performing an `isPresent` check on a
volatile Optional before accessing it in `get`, leaving the door open to
a race condition when the optional changes between `isPresent` and
`get`. This change takes a copy of the volatile variable first.
2025-05-17 21:17:38 +02:00
Bill Bejeck f397cbc14c
KAFKA-19256: Only send IQ metadata on assignment changes (#19691)
CI / build (push) Waiting to run Details
This PR adds changes, so the IQ endpoint information is only sent to
streams group members when there has been a change in the assignments
requiring an update in the streams client host-partition ownership.

The existing IQ integration test passes with no modifications and
updated the `GroupMetadataManagerTest` to cover the new process.

Reviewers: Matthias Sax <mjsax@apache.org>, Lucas Brutschy
 <lucasbru@apache.org>
2025-05-16 16:54:12 -04:00
Jhen-Yung Hsu ced56a320b
MINOR: Move logDirs config out of KafkaConfig (#19579)
CI / build (push) Waiting to run Details
Follow up https://github.com/apache/kafka/pull/19460/files#r2062664349

Reviewers: Ismael Juma <ismael@juma.me.uk>, PoAn Yang
<payang@apache.org>, TaiJuWu <tjwu1217@gmail.com>, Ken Huang
<s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-05-17 00:52:20 +08:00
Chirag Wadhwa 391b604c97
KAFKA-19226: Added test_console_share_consumer.py (#19708)
This PR includes the system test file test_console_share_consumer.py
which tests the functioning of ConsoleShareConsumer

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-05-16 17:33:46 +01:00
David Jacot 199772adc5
KAFKA-19141; Persist topic id in OffsetCommit record (#19683)
This patch adds the `TopicId` field to the `OffsetCommitValue` record as
a tagged field. It will be later used on the offset fetch path to ensure
that the persisted offset matches the requested one.

Reviewers: Dongnuo Lyu <dlyu@confluent.io>, Sean Quah
 <squah@confluent.io>, Lianet Magrans <lmagrans@confluent.io>
2025-05-16 10:26:36 -04:00
Mickael Maison b0b8f13252
MINOR: Fix broken HTML tag in SESSION_TIMEOUT_MS_DOC (#19740)
The unclosed `<code>` tag breaks the formatting of the docs.

Reviewers: Ken Huang <s7133700@gmail.com>, Lianet Magrans
 <lmagrans@confluent.io>
2025-05-16 10:19:10 -04:00
Federico Valeri 102d35190b
MINOR: Add JmxReporter note to metric.reporters (#19706)
CI / build (push) Waiting to run Details
According to KIP-830, in Kafka 4 users currently relying on JmxReporter
and that are using additional reporters via metric.reporters will have
to include org.apache.kafka.common.metrics.JmxReporter in
metric.reporters.

Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-05-16 11:58:01 +02:00
Matthias J. Sax 34e426b517
KAFKA-19271: Add internal ConsumerWrapper (#19697)
With KIP-1071 enabled, the main consumer is created differently,  side
stepping `KafkaClientSupplier`.

To allow injection test wrappers, we add an internal ConsumerWrapper,
until we define a new public interface.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-05-16 11:57:37 +02:00
Bolin Lin 21ffc07212
MINOR: migrate MinInSyncReplicasConfigTest to server module (#19727)
Migrate MinInSyncReplicasConfigTest to the server module


Reviewers: PoAn Yang <payang@apache.org>, Yung
 <yungyung7654321@gmail.com>, TengYao Chi <frankvicky@apache.org>, Ken
 Huang <s7133700@gmail.com>
2025-05-16 17:18:28 +08:00
Andrew Schofield 7ae9a26fc2
MINOR: Mark RemoteIndexCacheTest.testConcurrentRemoveReadForCache1 flaky (#19732)
Marking flaky test as a result of 5% failure rate.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-05-16 09:03:08 +01:00
Sushant Mahajan e70d05ecda
KAFKA-19217: Fix ShareConsumerTest.testComplexConsumer flakiness. (#19734)
* Added alter offset to earliest.
* Reduced produce time to reduce overall test time.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-05-16 09:00:16 +01:00
Matthias J. Sax 8fc41f9ca2
KAFKA-19171: Kafka Streams crashes with UnsupportedOperationException (#19507)
This PR fixes a regression bug introduced with KAFKA-17203. We need to
pass in mutable collections into `closeTaskClean(...)`.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bruno Cadonna <bruno@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2025-05-15 21:37:04 -07:00
Yunchi Pang f55565d321
KAFKA-19267 the min version used by ListOffsetsRequest should be 1 rather than 0 (#19709)
CI / build (push) Waiting to run Details
Updates the min version used by `ListOffsetsRequest` to
`ApiKeys.LIST_OFFSETS.oldestVersion()` rather than hardcoding `1`.

Reviewers: Ken Huang <s7133700@gmail.com>, PoAn Yang
 <payang@apache.org>, TengYao Chi <frankvicky@apache.org>, Chia-Ping
 Tsai <chia7712@gmail.com>
2025-05-16 10:33:16 +08:00
Matthias J. Sax bbf48ad677
KAFKA-19208: KStream-GlobalKTable join should not drop left-null-key record (#19580)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-05-15 18:34:07 -07:00
PoAn Yang c26b09c609
KAFKA-18904: [1/N] Change ListClientMetricsResources API to ListConfigResources (#19493)
* Change `ListClientMetricsResourcesRequest.json` to
`ListConfigResourcesRequest.json`.
* Change `ListClientMetricsResourcesResponse.json` to
`ListConfigResourcesResponse.json`.
* Change `ListClientMetricsResourcesRequest.java` to
`ListConfigResourcesRequest.java`.
* Change `ListClientMetricsResourcesResponse.java` to
`ListConfigResourcesResponsejava`.
* Change `KafkaApis` to handle both `ListClientMetricsResourcesRequest`
v0 and v1 requests.

Reviewers: Andrew Schofield <aschofield@confluent.io>

---------

Signed-off-by: PoAn Yang <payang@apache.org>
2025-05-15 23:39:00 +01:00
Andrew Schofield 567a03dd14
HOTFIX: Parameter mismatch in test for BrokerMetadataPublisher (#19733)
Recent changes to BrokerMetadataPublisher seem to have caused a mismatch
between the BrokerMetadataPublisher and its test.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Sushant Mahajan
 <smahajan@confluent.io>
2025-05-15 23:20:29 +01:00
Abhinav Dixit 2e0e9b9056
MINOR: Improvements for Persister APIs with respect to share group protocol enablement (#19719)
CI / build (push) Waiting to run Details
### About
Minor improvements to Persister APIs in KafkaApis with respect to share
group protocol enablement

### Testing
The new code added has been tested with the help of unit tests

Reviewers: Sushant Mahajan <sushant.mahajan88@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2025-05-15 18:29:16 +01:00
David Jacot c612cfff29
KAFKA-19274; Group Coordinator Shards are not unloaded when `__consumer_offsets` topic is deleted (#19713)
Group Coordinator Shards are not unloaded when `__consumer_offsets`
topic is deleted. The unloading is scheduled but it is ignored because
the epoch is equal to the current epoch:

```
[2025-05-13 08:46:00,883] INFO [GroupCoordinator id=1]
Scheduling  unloading of metadata for __consumer_offsets-0 with epoch
OptionalInt[0]
(org.apache.kafka.coordinator.common.runtime.CoordinatorRuntime)
[2025-05-13 08:46:00,883] INFO [GroupCoordinator id=1] Scheduling
unloading of metadata for __consumer_offsets-1 with epoch OptionalInt[0]
(org.apache.kafka.coordinator.common.runtime.CoordinatorRuntime)
[2025-05-13 08:46:00,883] INFO [GroupCoordinator id=1] Ignored unloading
metadata for __consumer_offsets-0 in epoch OptionalInt[0] since current
epoch is 0.
(org.apache.kafka.coordinator.common.runtime.CoordinatorRuntime)
[2025-05-13 08:46:00,883] INFO [GroupCoordinator id=1] Ignored unloading
metadata for __consumer_offsets-1 in epoch OptionalInt[0] since current
epoch is 0.
(org.apache.kafka.coordinator.common.runtime.CoordinatorRuntime)
```

This patch fixes the issue by not setting the leader epoch in this case.
The coordinator expects the leader epoch to be incremented when the
resignation code is called. When the topic is deleted, the epoch is not
incremented. Therefore, we must not use it. Note that this is aligned
with deleted partitions are handled too.

Reviewers: Dongnuo Lyu <dlyu@confluent.io>, José Armando García Sancio <jsancio@apache.org>
2025-05-15 19:04:38 +02:00
Lianet Magrans 8a577fa5af
MINOR: adding consumer fenced test and log (#19723)
Adding test to specifically force the fencing path due to delayed
rebalance, and validate how the consumer recovers automatically.

Running this test and DEBUG log enabled, allows to see the details of
the fencing flow: consumer getting fenced due to rebalance exceeded,
resetting to epoch 0, rejoining on the next poll with the existing
subscription, and being accepted back in the group (so consumption
resumes)

This is aimed to help understand
[KAFKA-19233](https://issues.apache.org/jira/browse/KAFKA-19233)

Will add another one in separate PR to also involve commits in similar
fencing scenarios.

Reviewers: TengYao Chi <frankvicky@apache.org>
2025-05-15 12:57:11 -04:00
David Arthur d47abb3c27
MINOR: Fix backticks in PR body (#19726)
This fixes the paragraph splitting done in the pr-format.py script. If a
line contains a triple backtick, the script will consider it markdown
and adjust the formatting accordingly.

Reviewers: TengYao Chi <frankvicky@apache.org>, Ken Huang <s7133700@gmail.com>, Jhen-Yung Hsu <jhenyunghsu@gmail.com>
2025-05-15 12:07:26 -04:00
Sushant Mahajan a26d803f22
MINOR: Remove share group code from group coord onElection. (#19730)
* Previously we had added code to `GroupCoordinatorService.onElection`
to reconcile pending share group initializing topics. This was done to
manage state in case of failovers and broker failures.
* However, we later modified share group heartbeat code to do the retry
to clean up the state and the `onElection` code is now redundant.
* In this PR we are cleaning up this code.

Reviewers: David Jacot <djacot@confluent.io>, Andrew Schofield <aschofield@confluent.io>
2025-05-15 07:27:25 -07:00
Chirag Wadhwa f9064f8bcd
KAFKA-19231-1: Handle fetch request when share session cache is full (#19701)
According to the recent changes in KIP-932, when the share session cache
is full and a broker receives a Share Fetch request with Initial Share
Session Epoch (0), then the error code `SHARE_SESSION_LIMIT_REACHED` is
returned after a delay of maxWaitMs. This PR implements this logic. In
order to add a delay between subsequent share fetch requests, the timer
is delayed operation purgatory is used. A new `IdleShareFetchTimeTask`
has been added which takes in a CompletableFuture<Void>. Upon the
expiration, this future is completed with null. When the future is
completes, a response is sent back to the client with the error code
`SHARE_SESSION_LIMIT_REACHED`

Reviewers: Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>
2025-05-15 14:36:44 +01:00
Sushant Mahajan 847968e530
KAFKA-19281: Add share enable flag to periodic jobs. (#19721)
* We have a few periodic timer tasks in `ShareCoordinatorService` which
run continuously.
* With the recent introduction of share group enabled config at feature
level, we would like these jobs to stop when the aforementioned feature
is disabled.
* In this PR, we have added the functionality to make that possible.
* Additionally the service has been supplemented with addition of a
static share group config supplier.
* New test has been added.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal
 <apoorvmittal10@gmail.com>
2025-05-15 14:05:06 +01:00
YuChia Ma 1c3c361629
KAFKA-19263 update `delete.topic.enable` docs (#19675)
If delete.topic.enable is false on the brokers, deleteTopics will mark
the topics for deletion, but not actually delete them. The futures will
return successfully in this case.

It is not true as the server return exception now.

```java if (!config.deleteTopicEnable) {   if (apiVersion < 3) { throw
new InvalidRequestException("Topic deletion is disabled.")    } else {
throw new TopicDeletionDisabledException()    } } ```

Reviewers: Nick Guo <lansg0504@gmail.com>, PoAn Yang
 <payang@apache.org>, Ken Huang <s7133700@gmail.com>, Jhen-Yung Hsu
 <jhenyunghsu@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-05-15 20:03:54 +08:00
Apoorv Mittal 6d45657cde
MINOR: Cleaning up code for share feature listener (#19715)
CI / build (push) Waiting to run Details
The PR is a minor follow up on
https://github.com/apache/kafka/pull/19659.

KafkaApis.scala already have a check which denies new share fetch
related calls if the share group is not supported. Hence no new sessions
shall be created so the requirement to have share group enabled flag in
ShareSessionCache is not needed, unless I am missing something.

Reviewers: Abhinav Dixit <adixit@confluent.io>, Andrew Schofield <aschofield@confluent.io>
2025-05-15 10:10:54 +01:00