Commit Graph

12798 Commits

Author SHA1 Message Date
Luke Chen d23931d5b6 Merge remote-tracking branch 'origin' into testRemoteLogManagerRemoteMetrics 2024-05-10 11:17:34 +08:00
Luke Chen bd53f8e430 test 2024-05-10 11:13:11 +08:00
Christo Lolov 4bece0131f
KAFKA-14133 Move StreamTaskTest to Mockito (#14716)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-10 11:07:06 +08:00
Lucia Cerchie 31528f581d
KAFKA-15307: update/note deprecated configs (#14360)
Configs default.windowed.value.serde.inner and default.windowed.key.serde.inner
were replace with windowed.inner.class.serde. This PR updates the docs accordingly,
plus a few more side cleanups.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-05-09 19:46:00 -07:00
ChickenchickenLove ff6d01c90f
KAFKA-15951: MissingSourceTopicException should include topic names (#15573)
MissingSourceTopicException should contain the name of the missing topic.
There is one corner case for which we don't have the topic name at hand, but we can log the topic
name somewhere else.

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-05-09 19:35:36 -07:00
Kuan-Po (Cooper) Tseng 7e9ab4b2c6
KAFKA-16484 Support to define per broker/controller property by ClusterConfigProperty (#15715)
Introduce a new field id in annotation ClusterConfigProperty. The main purpose of new field is to define specific broker/controller(kraft) property. And the default value is -1 which means the ClusterConfigProperty will apply to all broker/controller.

Note that under Type.KRAFT mode, the controller id starts from 3000, and then increments by one each time. Other modes the broker/controller id starts from 0 and then increments by one.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-10 10:31:45 +08:00
Antoine Pourchet 8fd6596454
KAFKA-15045: (KIP-924) New interfaces and stubbed utility classes for pluggable TaskAssignors. (#15887)
This is the first PR in a sequence to support custom task assignors in Kafka Streams, which was described in KIP 924. It creates and exposes all of the interfaces that will need to be implemented during the refactor of the current task assignment logic.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-09 19:14:53 -07:00
Ivan Yurchenko 5a9ccb6b77
KAFKA-16445: Add PATCH method for connector config (#6934)
Reviewers: Chris Egerton <chrise@aiven.io>
2024-05-09 21:59:09 +02:00
Andrew Schofield f4fdaa702a
MINOR: Add missing RPCs to security.html (#15878)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-09 20:51:00 +08:00
PoAn Yang 397d58b14c
MINOR: use classic consumer with ZK mode for DeleteOffsetsConsumerGroupCommandIntegrationTest (#15872)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-09 20:12:22 +08:00
Luke Chen 95476aaa70 test 2024-05-09 14:24:04 +08:00
Luke Chen 3ecdc109f8 test 2024-05-09 14:23:04 +08:00
Luke Chen ab2cf377f5 add more logs 2024-05-09 14:06:35 +08:00
Ayoub Omari 29f3260a9c
MINOR: Fix streams javadoc links (#15900)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-09 10:52:49 +08:00
Luke Chen f29484b517 Merge remote-tracking branch 'origin' into testRemoteLogManagerRemoteMetrics 2024-05-09 08:46:06 +08:00
Luke Chen 15020758f0 test 2024-05-09 08:42:54 +08:00
Luke Chen 8adfc6be42 remove integration 2024-05-09 08:35:40 +08:00
Luke Chen a0ee103041 test 2024-05-09 08:27:37 +08:00
Sanskar Jhajharia c64a315fd5
MINOR: Made the supportedOperation variable name more verbose (#15892)
As a part of 2e8d69b78c, we had introduced the TransactionAbortableException in AK. On more detailed analysis we figured out that the enum SupportedOperation was a bit misleading. Hence updated the same to TransactionSupportedOperation to allow a better and more defined function signature

Reviewers: Justine Olshan <jolshan@confluent.io>
2024-05-08 10:14:12 -07:00
Luke Chen 33e9eeb637 fix 2024-05-08 20:41:36 +08:00
Jorge Esteban Quilcate Otoya 2a5efe4a33
KAFKA-16685: Add parent exception to RLMTask warning logs (#15880)
KAFKA-16685: Add parent exception to RLMTask warning logs

Reviewers: Josep Prat <josep.prat@aiven.io>
2024-05-08 14:27:03 +02:00
Luke Chen 244103af95 teset 2024-05-08 20:24:25 +08:00
TingIāu "Ting" Kì f74f596bc7
KAFKA-16640 Replace TestUtils#resource by scala.util.Using (#15881)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-08 15:56:27 +08:00
Bruno Cadonna f7b242f94e
KAFKA-10199: Revoke tasks from state updater with new remove (#15871)
Uses the new remove operation of the state updater that returns
a future to remove revoked tasks from the state updater.

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-05-08 09:53:58 +02:00
Lucas Brutschy 3b43edd7a1
MINOR: Remove dev_version parameter from streams tests (#15874)
In two tests, we are using the current snapshot version as a test parameter
`to_version`, but as the only option. We can hardcode it. This
simplifies testing downstream, since the test parameters do not change
with every version. In particular, some tests downstream are blacklisted
because they do not work with ARM. These lists need to be updated every
time `DEV_VERSION` is bumped.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-05-08 09:43:26 +02:00
Kamal Chandraprakash 8655094e6c
KAFKA-16511: Fix the leaking tiered segments during segment deletion (#15817)
When there are overlapping segments in the remote storage, then the deletion may fail to remove the segments due to isRemoteSegmentWithinLeaderEpochs check. Once the deletion starts to fail for a partition, then segments won't be eligible for cleanup. The one workaround that we have is to move the log-start-offset using the kafka-delete-records script.

Reviewers: Luke Chen <showuon@gmail.com>, Satish Duggana <satishd@apache.org>
2024-05-08 15:21:23 +08:00
Luke Chen f9991935e3 test 2024-05-08 13:15:49 +08:00
Luke Chen 3dab6159e8 test 2024-05-08 13:06:53 +08:00
yuz10 5f933ac840
MINOR: Correct connector scheduled rebalance logs (#15875)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-08 12:32:47 +08:00
TingIāu "Ting" Kì a0f1658bb1
KAFKA-16678 Remove variable "unimplementedquorum" (#15879)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-08 12:30:34 +08:00
Luke Chen 3c25e02524 test 2024-05-08 08:05:34 +08:00
Luke Chen 9312174a0a test 2024-05-08 07:47:33 +08:00
vamossagar12 525b9b1d76
KAFKA-15018: Write connector tombstone offsets to secondary store before primary store (#13801)
Reviewers: Chris Egerton <chrise@aiven.io>
2024-05-07 14:29:02 -04:00
Jorge Esteban Quilcate Otoya a4c6cefd10
KAFKA-14226: Introduce FieldPath abstraction and nested path support for ExtractField SMT (#15379)
Reviewers: Chris Egerton <chrise@aiven.io>
2024-05-07 14:07:18 -04:00
Chris Egerton 05df10449e
KAFKA-13328, KAFKA-13329 (2): Add custom preflight validation support for connector header, key, and value converters (#14309)
Reviewers:  Greg Harris <greg.harris@aiven.io>
2024-05-07 11:30:57 -04:00
Jeff Kim 21bf715622
KAFKA-16307; Fix coordinator thread idle ratio (#15835)
This PR fixes the thread idle ratio. We take a similar approach to the kafka request handler idle ratio: https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/server/KafkaRequestHandler.scala#L108-L117

Instead of calculating the actual ratio per thread, we record the time each thread stays idle while waiting for a new event, divided by the number of threads as an approximation.

Reviewers: David Jacot <djacot@confluent.io>
2024-05-07 06:21:09 -07:00
Bruno Cadonna cb35ddc5ca
KAFKA-10199: Remove lost tasks in state updater with new remove (#15870)
Uses the new remove operation of the state updater that returns a future to remove lost tasks from the state udpater.

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-05-07 14:26:23 +02:00
Luke Chen f4a38eb5c9 KAFKA-16399: address review comments and fix flaky tests 2024-05-07 18:00:06 +08:00
Lianet Magrans ea485a7061
KAFKA-16665: Allow to initialize newly assigned partition's positions without allowing fetching while callback runs (#15856)
Fix to allow to initialize positions for newly assigned partitions, while the onPartitionsAssigned callback is running, even though the partitions remain non-fetchable until the callback completes.

Before this PR, we were not allowing initialization or fetching while the callback was running. The fix here only allows to initialize the newly assigned partition position, and keeps the existing logic for making sure that the partition remains non-fetchable until the callback completes.

The need for this fix came out in one of the connect system tests, that attempts to retrieve a newly assigned partition position with a call to consumer.position from within the onPartitionsAssigned callback (WorkerSinkTask). With this PR, we allow to make such calls (test added), which is the behaviour of the legacy consumer.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-05-07 10:40:00 +02:00
Dongnuo Lyu 459eaec666
KAFKA-16615; JoinGroup API for upgrading ConsumerGroup (#15798)
The patch implements JoinGroup API for the new consumer groups. It allow members using the classic rebalance protocol with the consumer embedded protocol to join a new consumer group.

Reviewers: David Jacot <djacot@confluent.io>
2024-05-06 23:59:10 -07:00
Matthias J. Sax d76352e215
MINOR: log newly created processId (#15851)
Reviewers: Colt McNealy <colt@littlehorse.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-07 14:14:35 +08:00
TingIāu "Ting" Kì 0de3b7c40b
KAFKA-16593 Rewrite DeleteConsumerGroupsTest by ClusterTestExtensions (#15766)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-07 14:04:32 +08:00
David Jacot 0df340d64d
KAFKA-16470 kafka-dump-log --offsets-decoder should support new records (#15652)
When the consumer group protocol is used in a cluster, it is, at the moment, impossible to see all records stored in the __consumer_offsets topic with kafka-dump-log --offsets-decoder. It does not know how to handle all the new records.

This patch refactors the OffsetsMessageParser used internally by kafka-dump-log to use the RecordSerde used by the new group coordinator. It ensures that the tool is always in sync with the coordinator implementation. The patch also changes the format to using the toString'ed representations of the records instead of having custom logic to dump them. It ensures that all the information is always dumped. The downside of the latest is that inner byte arrays (e.g. assignment in the classic protocol) are no longer deserialized. Personally, I feel like that it is acceptable and it is actually better to stay as close as possible to the actual records in this tool. It also avoids issues like https://issues.apache.org/jira/browse/KAFKA-15603.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-07 08:49:31 +08:00
David Arthur fe8ccbc92c
KAFKA-16539 Fix IncrementalAlterConfigs during ZK migration (#15744)
This patch fixes two issues with IncrementalAlterConfigs and the ZK migration. First, it changes the handling of IncrementalAlterConfigs to check if the controller is ZK vs KRaft and only forward for KRaft. Second, it adds a check in KafkaZkClient#setOrCreateEntityConfigs to ensure a ZK broker is not directly modifying configs in ZK if there is a KRaft controller. This closes the race condition between KRaft taking over as the active controller and the ZK brokers learning about this.

*Forwarding*

During the ZK migration, there is a time when the ZK brokers are running with migrations enabled, but KRaft has yet to take over as the controller. Prior to KRaft taking over as the controller, the ZK brokers in migration mode were unconditionally forwarding IncrementalAlterConfigs (IAC) to the ZK controller. This works for some config types, but breaks when setting BROKER and BROKER_LOGGER configs for a specific broker. The behavior in KafkaApis for IAC was to always forward if the forwarding manager was defined. Since ZK brokers in migration mode have forwarding enabled, the forwarding would happen, and the special logic for BROKER and BROKER_LOGGER would be missed, causing the request to fail.

With this fix, the IAC handler will check if the controller is KRaft or ZK and only forward for KRaft.

*Protected ZK Writes*

As part of KIP-500, we moved most (but not all) ZK mutations to the ZK controller. One of the things we did not move fully to the controller was entity configs. This is because there was some special logic that needed to run on the broker for certain config updates. If a broker-specific config was set, AdminClient would route the request to the proper broker. In KRaft, we have a different mechanism for handling broker-specific config updates.

Leaving this ZK update on the broker side would be okay if we were guarding writes on the controller epoch, but it turns out KafkaZkClient#setOrCreateEntityConfigs does unprotected "last writer wins" updates to ZK. This means a ZK broker could update the contents of ZK after the metadata had been migrated to KRaft. No good! To fix this, this patch adds a check on the controller epoch to KafkaZkClient#setOrCreateEntityConfigs but also adds logic to fail the update if the controller is a KRaft controller.

The new logic in setOrCreateEntityConfigs adds STALE_CONTROLLER_EPOCH as a new exception that can be thrown while updating configs.

Reviewers:  Luke Chen <showuon@gmail.com>, Akhilesh Chaganti <akhileshchg@users.noreply.github.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-07 08:29:57 +08:00
Andrew Schofield 4c4ae6e39c
KAFKA-16608 Honour interrupted thread state on KafkaConsumer.poll (#15803)
The contract of KafkaConsumer.poll(Duration) says that it throws InterruptException "if the calling thread is interrupted before or while this function is called". The new KafkaConsumer implementation was not doing this if the thread was interrupted before the poll was called, specifically with a very short timeout. If it ever waited for records, it did check the thread state. If it did not wait for records because of a short timeout, it did not.

Some of the log messages in the code erroneously mentioned timeouts, when they really meant interruption.

Also adds a test for this specific scenario.

Reviewers: Lianet Magrans <lianetmr@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-07 08:22:41 +08:00
Linu Shibu aeca384641
KAFKA-16356: Remove class-name dispatch in RemoteLogMetadataSerde (#15620)
Reviewers: Greg Harris <greg.harris@aiven.io>, Luke Chen <showuon@gmail.com>, Igor Soarez <soarez@apple.com>, The-Gamer-01 <19974361760@163.com>
2024-05-06 16:49:35 -07:00
Vedarth Sharma 0b4eaefd86
KAFKA-16646: KAFKA-16646Don't run cve scan job on forks (#15831)
Minor fix PR to ensure scan job runs only on apache/kafka

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Igor Soarez <soarez@apple.com>
2024-05-06 20:16:07 +05:30
David Jacot 42754336e1
MINOR: Remove `ConsumerGroupPartitionMetadataValue.Epoch` field (#15854)
ConsumerGroupPartitionMetadataValue.Epoch is not used anywhere so we can remove it. Note that we already have non-backward compatible changes lined up for 3.8 so it is fine to do it.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-06 05:02:39 -07:00
Okada Haruki 5c96ad61d9
KAFKA-16393 read/write sequence of buffers correctly (#15571)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-06 19:11:04 +08:00
Nikolay 6a8977e212
KAFKA-14588 [3/N] ConfigCommandTest rewritten in java (#15850)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-06 18:44:34 +08:00