Commit Graph

14665 Commits

Author SHA1 Message Date
yangjf2019 639bb51312
MINOR: Bump year to 2025 in NOTICE file (#18427)
Bump year to 2025 in NOTICE file

Reviewers: Luke Chen <showuon@gmail.com>
2025-01-08 10:06:16 +08:00
Ken Huang 6aef94e9ec
KAFKA-18411 Remove ZkProducerIdManager (#18413)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 04:23:27 +08:00
mingdaoy c40cc5740f
KAFKA-18408 tweak the 'tag' field for BrokerHeartbeatRequest.json, BrokerRegistrationChangeRecord.json and RegisterBrokerRecord.json (#18421)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 04:16:59 +08:00
TengYao Chi 2a073a14d2
KAFKA-18414 Remove KRaftRegistrationResult (#18401)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 04:09:28 +08:00
PoAn Yang 228b3252f6
KAFKA-17921 Support SASL_PLAINTEXT protocol with java.security.auth.login.config (#17671)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 03:34:06 +08:00
Ken Huang 9d93a4f68f
KAFKA-18384 Remove ZkAlterPartitionManager (#18364)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-07 18:08:57 +01:00
TengYao Chi abeed20168
KAFKA-10790: Add deadlock detection to producer#flush (#17946)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Andrew Schofield <aschofield@confluent.io>, TaiJuWu <tjwu1217@gmail.com>
2025-01-07 16:32:43 +00:00
TengYao Chi af255a0c37
KAFKA-18412: Remove EmbeddedZookeeper (#18399)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-07 17:08:00 +01:00
NICOLAS GUYOMAR 2fc35c81be
MINOR : Improve Exception log in NotEnoughReplicasException(#12394)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2025-01-07 20:21:02 +05:30
David Jacot 48b522fe86
MINOR: Improve PlaintextAdminIntegrationTest#testConsumerGroups (#18409)
Looking at the [history](https://ge.apache.org/scans/tests?search.rootProjectNames=kafka&search.timeZoneId=Europe%2FZurich&tests.container=kafka.api.PlaintextAdminIntegrationTest&tests.test=testConsumerGroups(String%2C%20String)%5B2%5D), I found out that one source of flakiness is due to syncCommit failing with CommitFailedException. We can ignore it and retry on the next iteration.

```
[2025-01-07 10:17:00,783] ERROR [Consumer instanceId=test_instance_id_1, clientId=test_client_id, groupId=test_group_id] OffsetCommit failed for member VfImExrxT3-w_HNJcTkqnw with stale member epoch error. Last epoch sent: 2 (org.apache.kafka.clients.consumer.internals.CommitRequestManager:773)
Exception in thread "Thread-6" org.apache.kafka.clients.consumer.CommitFailedException: OffsetCommit failed with stale member epoch.The member epoch is stale. The member must retry after receiving its updated member epoch via the ConsumerGroupHeartbeat API.
        at org.apache.kafka.clients.consumer.internals.CommitRequestManager.commitSyncExceptionForError(CommitRequestManager.java:481)
        at org.apache.kafka.clients.consumer.internals.CommitRequestManager.lambda$commitSyncWithRetries$7(CommitRequestManager.java:472)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
        at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
        at org.apache.kafka.clients.consumer.internals.CommitRequestManager$OffsetCommitRequestState.onResponse(CommitRequestManager.java:776)
        at org.apache.kafka.clients.consumer.internals.CommitRequestManager$RetriableRequestState.handleClientResponse(CommitRequestManager.java:893)
        at org.apache.kafka.clients.consumer.internals.CommitRequestManager$RetriableRequestState.lambda$buildRequestWithResponseHandling$0(CommitRequestManager.java:883)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
        at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
        at org.apache.kafka.clients.consumer.internals.NetworkClientDelegate$FutureCompletionHandler.onComplete(NetworkClientDelegate.java:433)
        at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:154)
        at org.apache.kafka.clients.NetworkClient.completeResponses(NetworkClient.java:669)
        at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:661)
        at org.apache.kafka.clients.consumer.internals.NetworkClientDelegate.poll(NetworkClientDelegate.java:153)
        at org.apache.kafka.clients.consumer.internals.ConsumerNetworkThread.runOnce(ConsumerNetworkThread.java:160)
        at org.apache.kafka.clients.consumer.internals.ConsumerNetworkThread.run(ConsumerNetworkThread.java:106)
```

Reviewers: Lianet Magrans <lmagrans@confluent.io>
2025-01-07 06:27:26 -08:00
xijiu 25890e99f1
MINOR: Remove unused local variable (#18410)
Reviewers: Luke Chen <showuon@gmail.com>
2025-01-07 14:25:12 +01:00
Colin Patrick McCabe d8236bec44
MINOR: Remove RaftManager.maybeDeleteMetadataLogDir and AutoTopicCreationManagerTest.scala (#17365)
Remove RaftManager.maybeDeleteMetadataLogDir since it was only used during ZK migration, and that code has been removed.

Similarly, remove RaftManagerTest.testKRaftBrokerDoesNotDeleteMetadataLog which tested that function.

Remove AutoTopicCreationManagerTest since it tests the ZK-mode-only AutoTopicReationManager.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-07 21:18:58 +08:00
Ken Huang d874aa42f3
KAFKA-18368 Remove TestUtils#MockZkConnect and remove zkConnect from TestUtils#createBrokerConfig (#18352)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-07 21:03:13 +08:00
NICOLAS GUYOMAR ea3459ee5d
MINOR: Update Consumer group timeout default to 30 sec (#16406)
30 sec is more inline with the default request.timeout.ms and is still very acceptable for a CLI interaction in my opinion

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2025-01-07 18:23:49 +05:30
David Jacot f974b3dcd4
MINOR: Fix typo in CommitRequestManager (#18407)
This patch fix a minor typo in CommitRequestManager.

Reviewers: Kamal Chandraprakash <kamal.chandraprakash@gmail.com>
2025-01-07 12:59:59 +01:00
Matthias J. Sax 738bd928f1
MINOR: cleanup JavaDocs for deprecation warnings (#18402)
Reviewers: Bill Bejeck <bbejeck@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-07 09:18:33 +00:00
David Jacot 7b6e94642a
KAFKA-18303; Update ShareCoordinator to use new record format (#18396)
Following https://github.com/apache/kafka/pull/18261, this patch updates the Share Coordinator to use the new record format.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-01-06 23:59:07 -08:00
Matthias J. Sax 3918f37af1
MINOR: Update Consumer and Producer JavaDocs for committing offsets (#18336)
The consumer/producer JavaDocs still contain instruction for naively
computing the offset to be committed.

This PR updates the JavaDocs with regard to the improvements of KIP-1094.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Lianet Magrans <lmagrans@confluent.io>
2025-01-06 13:39:20 -08:00
David Arthur c4840f5e93
KAFKA-16446: Improve controller event duration logging (#15622)
There are times when the controller has a high event processing time, such as during startup, or when creating a topic with many partitions. We can see these processing times in the p99 metric (kafka.controller:type=ControllerEventManager,name=EventQueueProcessingTimeMs), however it's difficult to see exactly which event is causing high processing time.

With DEBUG logs, we see every event along with its processing time. Even with this, it's a bit tedious to find the event with a high processing time.

This PR logs all events which take longer than 2 seconds at ERROR level. This will help identify events that are taking far too long, and which could be disruptive to the operation of the controller. The slow event logging looks like this:

```
[2024-12-20 15:03:39,754] ERROR [QuorumController id=1] Exceptionally slow controller event createTopics took 5240 ms.  (org.apache.kafka.controller.EventPerformanceMonitor)
```

Also, every 60 seconds, it logs some event time statistics, including average time, maximum time, and the name of the event which took the longest. This periodic message looks like this:

```
[2024-12-20 15:35:04,798] INFO [QuorumController id=1] In the last 60000 ms period, 333 events were completed, which took an average of 12.34 ms each. The slowest event was handleCommit[baseOffset=0], which took 41.90 ms. (org.apache.kafka.controller.EventPerformanceMonitor)
```

An operator can disable these logs by adding the following to their log4j config:

```
org.apache.kafka.controller.EventPerformanceMonitor=OFF
```

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2025-01-06 13:34:46 -08:00
PoAn Yang a52aedd6ff
KAFKA-18388 test-kraft-server-start.sh should use log4j2.yaml (#18370)
Reviewers: TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-07 04:20:06 +08:00
snehashisp ad3369859c
KAFKA-18419: KIP-891 Connect Multiversion Support (Transformation and Predicate Changes) (#17742)
Reviewers: Greg Harris <greg.harris@aiven.io>
2025-01-06 12:18:45 -08:00
mingdaoy 23e77ed2d4
KAFKA-18374 Remove EncryptingPasswordEncoder, CipherParamsEncoder, GcmParamsEncoder, IvParamsEncoder, and the unused static variables in PasswordEncoder (#18355)
Reviewers: TengYao Chi <kitingiao@gmail.com>, TaiJuWu <tjwu1217@gmail.com>, Christo Lolov <lolovc@amazon.com>, PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-07 03:48:33 +08:00
Xuan-Zhang Gong 3d1febf9bb
MINOR: Replace scala $var by java string (#18393)
Reviewers: Luke Chen <showuon@gmail.com>, TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-07 03:38:31 +08:00
Zhihong Yu c116354908
MINOR: Use clear method to speed up removal (#18400)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-01-06 17:50:18 +00:00
Lucas Brutschy 2521aee7d4
KAFKA-18311: Configuring changelog topics (2/N) (#18379)
A simplified port of "ChangelogTopics" from the client-side to the group coordinator

Compared to the client-side version, the implementation uses immutable data structures, and returns the computed number of partitions instead of modifying mutable data structures and calling the admin client.

Reviewers: Bruno Cadonna <cadonna@apache.org>
2025-01-06 17:17:28 +01:00
santhoshct e546b0225b
KAFKA-18307: Don't report on disabled/removed tests (#18318)
This patch ensures we only analyze trunk builds for the Develocity report. Some other minor fixes are also included

Reviewers: David Arthur <mumrah@gmail.com>
2025-01-06 10:54:51 -05:00
kevin-wu24 9818e9db26
KAFKA-17278; Add KRaft RPC compatibility tests (#17801)
Adds RPC compatibility tests for FETCH and FETCH_SNAPSHOT.

Reviewers: José Armando García Sancio <jsancio@apache.org>
2025-01-06 10:18:13 -05:00
Andrew Schofield 53a8b6189a
KAFKA-17539: Application metrics extension for share consumer (#18377)
Reviewers: Christo Lolov <lolovc@amazon.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2025-01-06 15:06:38 +00:00
Mickael Maison 64bbdb1a03
KAFKA-17616: Remove KafkaServer (#18384)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Ken Huang <s7133700@gmail.com>
2025-01-06 14:36:08 +01:00
Lucas Brutschy 35489bfca3
KAFKA-18311: Add internal datastructure for configuring topologies (1/N) (#18268)
Clients in the Streams Rebalance Protocol send an "unconfigured" representation of the topology to the broker. That is, the number of input topics and (some) internal topics is not fixed, regular expressions are not resolved. The broker takes this description of the topology and, together with the current state of the topics on the broker, derives a ConfiguredTopology. The configured topology is what is being returned from StreamsGroupDescribe, and has all number of partitions defined, and regular expressions resolved. The configured topology also contains missing internal topics that need to be created, and potentially configuration errors, such as missing source topics.

In this change, we add the internal data structures for representing the configured topology. They differ in some details from the data structures used in the RPCs. Most importantly, they can be evolved independently of the public interface.

Reviewers: Bruno Cadonna <cadonna@apache.org>
2025-01-06 13:51:00 +01:00
TengYao Chi 2e4a378c27
KAFKA-18131: Improve logs for voters (#18028)
Currently, the log of LeaderState#timeUntilCheckQuorumExpires uses streams without a terminal operator, resulting in output like java.util.stream.ReferencePipeline$3@39660237.
This PR aims to fix this issue and improve the log message.

Reviewers: Luke Chen <showuon@gmail.com>
2025-01-06 18:12:46 +08:00
ClarkChen b9354d6886
MINOR: Fix newline not working in LISTENERS_DOC (#18388)
Reviewers: Ken Huang <s7133700@gmail.com>, PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-06 14:04:23 +08:00
Ken Huang bbcc297e37
KAFKA-18358: Replace Deprecated $buildDir variable in build.gradle (#18343)
Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-05 14:18:27 +01:00
Ken Huang a628d9bc4d
KAFKA-18365 Remove zookeeper.connect in Test (#18353)
Reviewers: TaiJuWu <tjwu1217@gmail.com>, PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-04 23:04:21 +08:00
Ismael Juma 409a43eff7
MINOR: Collection/Option usage simplification via methods introduced in Java 9 & 11 (#18305)
Relevant methods:
1. `List.of`, `Set.of`, `Map.of` and similar (introduced in Java 9)
2. Optional: `isEmpty` (introduced in Java 11), `stream` (introduced in Java 9).

Reviewers: Mickael Maison <mimaison@users.noreply.github.com>
2025-01-03 16:13:39 -08:00
Matthias J. Sax ca511cd1cf
MINOR: update Kafka Streams docs for 4.0 KIP changes (#18307)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-01-03 12:47:15 -08:00
Matthias J. Sax 40e05435a2
MINOR: add broadcast/multicast to Kafka Streams docs (#18341)
Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2025-01-03 10:38:27 -08:00
Ismael Juma 73ab7ee4ea
MINOR: Use `Files.readString/writeString` and `String.repeat` to simplify code (#18372)
The 3 methods were introduced in Java 11.

Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-02 17:50:27 -08:00
Ismael Juma d6f24d3665
Use `instanceof` pattern to avoid explicit cast (#18373)
This feature was introduced in Java 16.

Reviewers: David Arthur <mumrah@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2025-01-02 09:32:51 -08:00
David Arthur a2a8d87153
MINOR remove some flaky annotations (#18357)
Remove the flaky annotation from the following tests

* RemoteLogManagerTest#testFetchOffsetByTimestampWithTieredStorageDoesNotFetchIndexWhenExistsLocally
* All the children of BaseConsumerTest#testCoordinatorFailover
* TransactionsTest#testFailureToFenceEpoch
* TransactionsTest#testReadCommittedConsumerShouldNotSeeUndecidedData
* MetricsDuringTopicCreationDeletionTest#testMetricsDuringTopicCreateDelete
* ProduceRequestTest#testProduceWithInvalidTimestamp

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-02 11:04:50 -05:00
Lucas Brutschy dd0fd55316
KAFKA-18319: Add task assignor interfaces (#18270)
Introduces interfaces for defining task assignors. Task assignors are pure functions, mapping the state of the group and a topology to a target assignment. We include a mock assignor, which we will be able to use when testing / benchmarking without the complexities of the sticky task assignor and the high-availability task assignor. We may remove the mock assignor in before the streams rebalance protocol goes GA.

The consumer groups introduce these interfaces to establish a clear separation between the group coordinator code and the pluggable assignors, which may live outside the group coordinator code. We have removed pluggable assignors in KIP-1071, but I think it still makes sense to keep these interfaces for having a clean interface for people to code against. This will pay off, if we plan on making the task assignors pluggable later.

Reviewers: Bill Bejeck <bbejeck@gmail.com>, David Jacot <djacot@confluent.io>
2025-01-02 16:31:35 +01:00
Andrew Schofield 0344f8f5ae
KAFKA-18273: KIP-1099 verbose display share group options (#18259)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2025-01-02 09:12:52 +00:00
Ken Huang 4896d02ca7
MINOR: fix sh command and properties file (#18369)
In document the shell command base dir is in Kafka, so we should make all command is bin/<tools>.sh
In kafka repo doesn't have controller_static.properties this file, this would misunderstanding user, I change to use controller.properties

Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-02 09:35:58 +08:00
xijiu dbf4602c13
KAFKA-18367 Remove ZkConfigManager (#18363)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-01 21:16:25 +08:00
TengYao Chi 5ae4b62876
KAFKA-18347 Add tools-log4j2.yaml to config and remove unsed tools-log4j.properties from config (#18351)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-01 21:06:01 +08:00
xijiu ce5bd197c1
KAFKA-18375 Update the LICENSE-binary (#18359)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-01 20:54:08 +08:00
Ismael Juma 083e344b30
MINOR: Remove PureJavaCrc32C and reflective code for CRC32C (#18361)
This is no longer required since we dropped support for Java 8. Also update `NOTICE*` and
`spotbugs-exclude.xml` files.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>
2025-01-01 02:08:06 -08:00
A. Sophie Blee-Goldman 86b552835c
KAFKA-18026: KIP-1112, configure all StoreBuilder & StoreFactory layers (#18345)
Because of how we have to wrap StoreFactory and StoreBuilder layers on top of each other for various parts of the topology building process, we need to make sure both of these are capable of configuration and will check for & delegate to an underlying layer if it exists

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>
2024-12-31 11:45:29 -08:00
Apoorv Mittal f88cf57e1c
KAFKA-12469: Deprecated and corrected topic metrics for consumer (KIP-1109) (#18232)
The PR implements the behaviour defined in KIP-1109. It corrects the consumer topic and topic-partition metrics, while deprecating the incorrect ones.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Jun Rao <junrao@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2024-12-31 17:35:47 +00:00
xijiu 5f8cf0e1f5
KAFKA-17421 Add integration tests for ConsumerRecord#leaderEpoch (#18254)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-01 00:37:31 +08:00