Commit Graph

12938 Commits

Author SHA1 Message Date
Mickael Maison b6d0fb055d
MINOR: Refactor DynamicConfig (#16133)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-01 01:09:46 +08:00
Josep Prat 7e81cc5e68
MINOR: Bump trunk to 3.9.0-SNAPSHOT (#16150)
Signed-off-by: Josep Prat <josep.prat@aiven.io>

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-31 16:41:44 +02:00
Ken Huang 21caf6b123
KAFKA-16629 Add broker-related tests to ConfigCommandIntegrationTest (#15840)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-31 20:24:33 +08:00
TingIāu "Ting" Kì 0971924ebc
KAFKA-16824: Utils.getHost and Utils.getPort do not catch a lot of invalid host and ports. (#16048)
Modify regex of HOST_PORT_PATTERN to prevent malformed hosts and ports.

Reviewers: Luke Chen <showuon@gmail.com>
2024-05-31 16:50:27 +08:00
Lianet Magrans eb39031cd0
KAFKA-16766: offset fetch timeout exception in new consumer consistent with legacy (#16125)
* Timeout exception fetching offsets

* Tests
2024-05-31 10:33:20 +02:00
Kuan-Po (Cooper) Tseng 3d125a2322
MINOR: Add more unit tests to LogSegments (#16085)
add more unit tests to LogSegments and do some small refactor in LogSegments.java

Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-31 16:07:38 +08:00
Bruno Cadonna 76d1f18e42
Revert "KAFKA-16448: Add ProcessingExceptionHandler interface and implementations (#16090)" (#16142)
This reverts commit 8d11d95795.

We decided to not release KIP-1033 with AK 3.8

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-05-31 09:56:36 +02:00
Chia-Ping Tsai b0fb2ac06d
KAFKA-16866 RemoteLogManagerTest.testCopyQuotaManagerConfig failing (#16146)
Reviewers: Justine Olshan <jolshan@confluent.io>, Satish Duggana <satishd@apache.org>
2024-05-31 06:32:50 +05:30
Antoine Pourchet 370e5ea1f8
KAFKA-15045: (KIP-924 pt. 15) Implement #defaultStandbyTaskAssignment and finish rack-aware standby optimization (#16129)
This fills in the implementation details of the standby task assignment utility functions within TaskAssignmentUtils.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-30 15:11:33 -07:00
Justine Olshan 7c1bb1585f
KAFKA-16308 [2/N]: Allow unstable feature versions and rename unstable metadata config (#16130)
As per KIP-1022, we will rename the unstable metadata versions enabled config to support all feature versions.

Features is also updated to return latest production and latest testing versions of each feature.

A feature is production ready when the corresponding metadata version (bootstrapMetadataVersion) is production ready.

Adds tests for the feature usage of the unstableFeatureVersionsEnabled config

Reviewers: David Jacot <djacot@confluent.io>, Jun Rao <junrao@gmail.com>
2024-05-30 14:52:50 -07:00
Alyssa Huang a8e99eb969
KAFKA-16833 Fixing PartitionInfo and Cluster equals and hashCode (#16062)
Reviewers: Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-31 05:00:42 +08:00
Sanskar Jhajharia e974914ca5
MINOR: Code Cleanup - Connect Module (#16066)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-31 04:55:00 +08:00
Ahmed Najiub 33a292e4dd
MINOR: Adds a test case to test that an exception is thrown in invalid ports (#16112)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-31 04:38:23 +08:00
David Jacot cd750582c0
MINOR: Enable transaction verification with new group coordinator in TransactionsTest (#16139)
While working on https://github.com/apache/kafka/pull/16120, I noticed that the transaction verification feature is disabled in `TransactionsTest` when the new group coordinator is enabled. We did this initially because the feature was not available in the new group coordinator but we fixed it a long time ago. We can enable it now.

Reviewers: Justine Olshan <jolshan@confluent.io>
2024-05-30 12:35:29 -07:00
Murali Basani 701f8e7ad4
KAFKA-16802: Move java versions inside java block to resolve deprecation (#16135)
Reviewers: Greg Harris <greg.harris@aiven.io>
2024-05-30 12:11:35 -07:00
Dongnuo Lyu a626e87303
MINOR: Make public the consumer group migration policy config
This patch exposes the group coordinator config `CONSUMER_GROUP_MIGRATION_POLICY_CONFIG`.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>
2024-05-30 11:36:11 -07:00
Krishna Agarwal bb6a042e99
KAFKA-16827: Integrate kafka native-image with system tests (#16046)
This PR does following things

System tests should bring up Kafka broker in the native mode
System tests should run on Kafka broker in native mode
Extract out native build command so that it can be reused.
Allow system tests to run on Native Kafka broker using Docker mechanism

To run system tests by bringing up Kafka in native mode:
Pass kafka_mode as native in the ducktape globals:--globals '{\"kafka_mode\":\"native\"}'

Running system tests by bringing up kafka in native mode via docker mechanism
_DUCKTAPE_OPTIONS="--globals '{\"kafka_mode\":\"native\"}'" TC_PATHS="tests/kafkatest/tests/"  bash tests/docker/run_tests.sh

To only bring up ducker nodes to cater native kafka
bash tests/docker/ducker-ak up -m native

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2024-05-30 22:24:23 +05:30
Abhijeet Kumar bb7db87f98
KAFKA-15265: Add Remote Log Manager quota manager (#15625)
Added the implementation of the quota manager that will be used to throttle copy and fetch requests from the remote storage. Reference KIP-956

Reviewers: Luke Chen <showuon@gmail.com>, Kamal Chandraprakash <kchandraprakash@uber.com>, Jun Rao <junrao@gmail.com>
2024-05-30 09:06:49 -07:00
Bruno Cadonna fea3eeb7f7
Revert "KAFKA-16448: Add ProcessingExceptionHandler in Streams configuration (#16092)" (#16141)
This reverts commit 3f70c46874.

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-05-30 17:52:07 +02:00
Fan Yang 32b2b73f67
KAFKA-16844: Add ByteBuffer support for Connect ByteArrayConverter (#16101)
Reviewers: Chris Egerton <chrise@aiven.io>
2024-05-30 11:26:25 -04:00
Ken Huang 3327435c8d
KAFKA-16598 Mirgrate `ResetConsumerGroupOffsetTest` to new test infra (#15779)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-30 21:51:16 +08:00
PoAn Yang 3b92046c08
MINOR: migrate ListConsumerGroupTest to use ClusterTestExtensions (#15821)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-30 21:30:19 +08:00
Mickael Maison 8068a086a3
MINOR: Remove KafkaConfig dependency in KafkaRequestHandler (#16108)
Reviewers: Luke Chen <showuon@gmail.com>, Apoorv Mittal <amittal@confluent.io>
2024-05-30 11:51:24 +02:00
Loïc GREFFIER 3f70c46874
KAFKA-16448: Add ProcessingExceptionHandler in Streams configuration (#16092)
This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler in Streams configuration.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: sebastienviale <sebastien.viale@michelin.com>

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-05-30 10:39:38 +02:00
David Jacot 2a6078a4ce
MINOR: Prevent consumer protocol to be used in ZK mode (#16121)
This patch disallows enabling the new consumer rebalance protocol in ZK mode.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Justine Olshan <jolshan@confluent.io>
2024-05-29 23:02:21 -07:00
dengziming 131ce0ba59
Minor: Fix VoterSetHistoryTest.testAddAt (#16104)
Reviewers: Luke Chen <showuon@gmail.com>
2024-05-30 10:28:07 +08:00
Murali Basani 3d14690cbf
KAFKA-16790: Update RemoteLogManager configuration in broker server (#16005)
n BrokerServer.scala, brokerMetadataPublishers are configured and when there are metadata updates remoteLogManager is not configured by then.
Ex : remoteLogManager.foreach(rlm => rlm.onLeadershipChange(partitionsBecomeLeader.asJava, partitionsBecomeFollower.asJava, topicIds)) in ReplicaManager is invoked after publishers are instantiated, and here rlm has relevant managers configured.

This change makes sure rlm is configured before the brokerMetadataPublishers initialization.

Reviewers: Luke Chen <showuon@gmail.com>, Nikhil Ramakrishnan <nikrmk@amazon.com>
2024-05-30 08:21:30 +08:00
Calvin Liu c8af740bd4
Improve producer ID expiration performance (#16075)
Skip using stream when expiring the producer ID. This can improve the performance significantly when the count is high.
Before

Benchmark                                        (numProducerIds)  Mode  Cnt      Score       Error  Units
ProducerStateManagerBench.testDeleteExpiringIds             10000  avgt    3    101.253 ±    28.031  us/op
ProducerStateManagerBench.testDeleteExpiringIds            100000  avgt    3   2297.219 ±  1690.486  us/op
ProducerStateManagerBench.testDeleteExpiringIds           1000000  avgt    3  30688.865 ± 16348.768  us/op
After

Benchmark                                        (numProducerIds)  Mode  Cnt     Score     Error  Units
ProducerStateManagerBench.testDeleteExpiringIds             10000  avgt    3    39.122 ±   1.151  us/op
ProducerStateManagerBench.testDeleteExpiringIds            100000  avgt    3   464.363 ±  98.857  us/op
ProducerStateManagerBench.testDeleteExpiringIds           1000000  avgt    3  5731.169 ± 674.380  us/op
Also, made a change to the JMH testing which excludes the producer ID populating from the testing.

Reviewers: Artem Livshits <alivshits@confluent.io>, Justine Olshan <jolshan@confluent.io>
2024-05-29 16:49:55 -07:00
Justine Olshan 5e3df22095
KAFKA-16308 [1/N]: Create FeatureVersion interface and add `--feature` flag and handling to StorageTool (#15685)
As part of KIP-1022, I have created an interface for all the new features to be used when parsing the command line arguments, doing validations, getting default versions, etc.

I've also added the --feature flag to the storage tool to show how it will be used.

Created a TestFeatureVersion to show an implementation of the interface (besides MetadataVersion which is unique) and added tests using this new test feature.

I will add the unstable config and tests in a followup.

Reviewers: David Mao <dmao@confluent.io>, David Jacot <djacot@confluent.io>, Artem Livshits <alivshits@confluent.io>, Jun Rao <junrao@apache.org>
2024-05-29 16:36:06 -07:00
Antoine Pourchet 5c08ee0062
KAFKA-15045: (KIP-924 pt. 9) TaskAssignmentUtils implementation of optimizeRackAwareActiveTasks (#16033)
This PR implements the rack aware optimization of active tasks that can be used by the assignors themselves. It takes in the full output of the assignment and tries to reorganize it so as to minimize cross-rack traffic.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-29 16:11:37 -07:00
Mickael Maison 3f3f3ac155
MINOR: Delete KafkaSecurityConfigs class (#16113)
Reviewers: Omnia Ibrahim <o.g.h.ibrahim@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-30 05:55:24 +08:00
Antoine Pourchet cc269b0d43
KAFKA-15045: (KIP-924 pt. 14) Callback to TaskAssignor::onAssignmentComputed (#16123)
This PR adds the logic and wiring necessary to make the callback to
TaskAssignor::onAssignmentComputed with the necessary parameters.

We also fixed some log statements in the actual assignment error
computation, as well as modified the ApplicationState::allTasks method
to return a Map instead of a Set of TaskInfos.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-29 13:15:02 -07:00
Eugene Mitskevich 862ea12cd7
MINOR: Fix rate metric spikes (#15889)
Rate reports value in the form of sumOrCount/monitoredWindowSize. It has a bug in monitoredWindowSize calculation, which leads to spikes in result values.

Reviewers: Jun Rao <junrao@gmail.com>
2024-05-29 13:14:37 -07:00
gongxuanzhang 0f0c9ecbf3
KAFKA-16771 First log directory printed twice when formatting storage (#16010)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-30 01:08:17 +08:00
Andrew Schofield 2d9994e0de
KAFKA-16722: Introduce ConsumerGroupPartitionAssignor interface (#15998)
KIP-932 introduces share groups to go alongside consumer groups. Both kinds of group use server-side assignors but it is unlikely that a single assignor class would be suitable for both. As a result, the KIP introduces specific interfaces for consumer group and share group partition assignors.

This PR introduces only the consumer group interface, `o.a.k.coordinator.group.assignor.ConsumerGroupPartitionAssignor`. The share group interface will come in a later release. The existing implementations of the general `PartitionAssignor` interface have been changed to implement `ConsumerGroupPartitionAssignor` instead and all other code changes are just propagating the change throughout the codebase.

Note that the code in the group coordinator that actually calculates assignments uses the general `PartitionAssignor` interface so that it can be used with both kinds of group, even though the assignors themselves are specific.

Reviewers: Apoorv Mittal <amittal@confluent.io>, David Jacot <djacot@confluent.io>
2024-05-29 08:31:52 -07:00
gongxuanzhang 0b75cf7c0b
KAFKA-16705 the flag "started" of RaftClusterInstance is false even though the cluster is started (#15946)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-29 22:38:00 +08:00
Loïc GREFFIER 8d11d95795
KAFKA-16448: Add ProcessingExceptionHandler interface and implementations (#16090)
This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler interface and default implementations.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: sebastienviale <sebastien.viale@michelin.com>

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-05-29 14:09:22 +02:00
Ramin Gharib b73f4798a4
KAFKA-16362: Fix type-unsafety in KStreamKStreamJoin caused by isLeftSide (#15601)
The introduced changes provide a cleaner definition of the join side in KStreamKStreamJoin. Before, this was done by using a Boolean flag, which led to returning a raw LeftOrRightValue without generic arguments because the generic type arguments depended on the boolean input.

Reviewers: Greg Harris <greg.harris@aiven.io>, Bruno Cadonna <cadonna@apache.org>
2024-05-29 13:12:54 +02:00
Luke Chen 897cab2a61
KAFKA-16399: Add JBOD support in tiered storage (#15690)
After JBOD is supported in KRaft, we should also enable JBOD support in tiered storage. Unit tests and Integration tests are also added.

Reviewers: Satish Duggana <satishd@apache.org>, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Igor Soarez <soarez@apple.com>, Mickael Maison <mickael.maison@gmail.com>
2024-05-29 15:30:18 +08:00
Dongnuo Lyu eefd114c4a
KAFKA-16832; LeaveGroup API for upgrading ConsumerGroup (#16057)
This patch implements the LeaveGroup API to the consumer groups that are in the mixed mode.

Reviewers: Jeff Kim <jeff.kim@confluent.io>, David Jacot <djacot@confluent.io>
2024-05-28 23:21:30 -07:00
A. Sophie Blee-Goldman 9562143f08
HOTFIX: remove unnecessary list creation (#16117)
Removing a redundant list declaration in the new StickyTaskAssignor implementation

Reviewers: Antoine Pourchet <antoine@responsive.dev>
2024-05-28 21:35:02 -07:00
Antoine Pourchet d64e3fbb2b
KAFKA-15045: (KIP-924 pt. 13) AssignmentError calculation added (#16114)
This PR adds the post-processing of the TaskAssignment to figure out if the new assignment is valid, and return an AssignmentError otherwise.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-28 19:43:30 -07:00
Antoine Pourchet 8d243dfbd4
KAFKA-15045: (KIP-924 pt. 12) Wiring in new assignment configs and logic (#16074)
This PR creates the new public config of KIP-924 in StreamsConfig and uses it to instantiate user-created TaskAssignors. If such a TaskAssignor is found and successfully created we then use that assignor to perform the task assignment, otherwise we revert back to the pre KIP-924 world with the internal task assignors.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Almog Gavra <almog@responsive.dev>
2024-05-28 18:01:18 -07:00
Antoine Pourchet 56ee1392e8
KAFKA-15045: (KIP-924 pt. 11) Implemented StickyTaskAssignor (#16052)
This PR implements the StickyTaskAssignor with the new KIP 924 API.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-28 17:05:51 -07:00
Nick Telford 59ba555142
KAFKA-15541: Add oldest-iterator-open-since-ms metric (#16041)
Part of [KIP-989](https://cwiki.apache.org/confluence/x/9KCzDw).

This new `StateStore` metric tracks the timestamp that the oldest
surviving Iterator was created.

This timestamp should continue to climb, and closely track the current
time, as old iterators are closed and new ones created. If the timestamp
remains very low (i.e. old), that suggests an Iterator has leaked, which
should enable users to isolate the affected store.

It will report no data when there are no currently open Iterators.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-05-28 16:23:23 -07:00
Frederik Rouleau 4eb60b5104
KAFKA-16507 Add KeyDeserializationException and ValueDeserializationException with record content (#15691)
Implements KIP-1036.

Add raw ConsumerRecord data to RecordDeserialisationException to make DLQ implementation easier.

Reviewers: Kirk True <ktrue@confluent.io>, Andrew Schofield <aschofield@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-05-28 14:56:47 -07:00
PoAn Yang 4d04eb83ea
KAFKA-16796 Introduce new org.apache.kafka.tools.api.Decoder to replace kafka.serializer.Decoder (#16064)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-29 03:13:33 +08:00
Luke Chen a649bc457f
KAFKA-16711: Make sure to update highestOffsetInRemoteStorage after log dir change (#15947)
Reviewers: Kamal Chandraprakash<kamal.chandraprakash@gmail.com>, Satish Duggana <satishd@apache.org>
2024-05-28 21:35:49 +05:30
Omnia Ibrahim 64f699aeea
KAFKA-15853: Move general configs out of KafkaConfig (#16040)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-28 16:22:54 +02:00
Sanskar Jhajharia 699438b7f7
MINOR: Fix the config name in ProducerFailureHandlingTest (#16099)
When moving from KafkaConfig.ReplicaFetchMaxBytesProp we used ReplicationConfigs.REPLICA_LAG_TIME_MAX_MS_CONFIG instead of ReplicationConfigs.REPLICA_FETCH_MAX_BYTES_CONFIG. This PR patches the same.

Reviewers: Omnia Ibrahim <o.g.h.ibrahim@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
2024-05-28 16:34:44 +05:30