Commit Graph

653 Commits

Author SHA1 Message Date
TengYao Chi 393455eb1a
KAFKA-17837 Rewrite DeleteTopicTest (#17579)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-10 03:06:52 +08:00
Apoorv Mittal 4966aed40d
KAFKA-17970 Moving some share purgatory classes from core to share module (#17722)
As part of PR: https://github.com/apache/kafka/pull/17636 where purgatory has been moved from core to server-common hence move some existing classes used in Share Fetch to Share module.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-10 01:04:17 +08:00
Mickael Maison 0049b967e5
KAFKA-17890: Move DelayedOperationPurgatory to server-common (#17636)
Reviewers: Jun Rao <jun@confluent.io>, Apoorv Mittal <amittal@confluent.io>
2024-11-08 09:55:09 +01:00
Bill Bejeck 4ed0a958e5
KAFKA-17248 - KIP 1076 implementation (#17021)
Implementation of KIP-1076 to allow for adding client application metrics to the KIP-714 framework

Reviewers: Apoorv Mittal <amittal@confluent.io>, Andrew Schofield <aschofield@confluent.io>, Matthias Sax <mjsax@apache.org>
2024-11-05 11:29:54 -05:00
Kuan-Po Tseng e3f953483c
KAFKA-17857 Move AbstractResetIntegrationTest and subclasses to tools (#17594)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-05 04:16:19 +08:00
David Jacot 64f3ee4c33
KAFKA-17593; [2/N] Update request validation & validate regex (#17651)
This patch does two things:
1) Change the validation of the ConsumerGroupHeartbeat request to accept subscribed topic names and/or subscribed topic regex. At least of them must be set in the first request with epoch 0.
2) Validate the provided regular expression by compiling it.

Co-authored-by: Lianet Magrans <lmagrans@confluent.io>

Reviewers: Jeff Kim <jeff.kim@confluent.io>, Lianet Magrans <lmagrans@confluent.io>
2024-11-04 06:38:09 -08:00
Yung 0799715f2c
KAFKA-17795 Fix the file path of suppressions.xml to run build on windows (#17674)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-03 21:36:11 +08:00
Ken Huang 30b1bdfc74
KAFKA-17835 Move ProducerIdManager and RPCProducerIdManager to transaction-coordinator module (#17562)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-31 02:40:47 +08:00
Nick Telford 571f50817c
KAFKA-17411: Create local state Standbys on start (#16922)
Instead of waiting until Tasks are assigned to us, we pre-emptively
create a StandbyTask for each non-empty Task directory found on-disk.

We do this before starting any StreamThreads, and on our first
assignment (after joining the consumer group), we recycle any of these
StandbyTasks that were assigned to us, either as an Active or a
Standby.

We can't just use these "initial Standbys" as-is, because they were
constructed outside the context of a StreamThread, so we first have to
update them with the context (log context, ChangelogReader, and source
topics) of the thread that it has been assigned to.

The motivation for this is to (in a later commit) read StateStore
offsets for unowned Tasks from the StateStore itself, rather than the
.checkpoint file, which we plan to deprecate and remove.

There are a few additional benefits:

Initializing these Tasks on start-up, instead of on-assignment, will
reduce the time between a member joining the consumer group and beginning
processing. This is especially important when active tasks are being moved
over, for example, as part of a rolling restart.

If a Task has corrupt data on-disk, it will be discovered on startup and
wiped under EOS. This is preferable to wiping the state after being
assigned the Task, because another instance may have non-corrupt data and
would not need to restore (as much).

There is a potential performance impact: we open all on-disk Task
StateStores, and keep them all open until we have our first assignment.
This could require large amounts of memory, in particular when there are
a large number of local state stores on-disk.

However, since old local state for Tasks we don't own is automatically
cleaned up after a period of time, in practice, we will almost always
only be dealing with the state that was last assigned to the local
instance.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Bruno Cadonna <cadonna@apache.org>, Matthias Sax <mjsax@apache.org>
2024-10-29 12:59:25 -07:00
Sushant Mahajan 5f92f60bff
KAFKA-17329: DefaultStatePersister implementation (#17270)
Adds the DefaultStatePersister and other supporting classes for managing share state.

* Added DefaultStatePersister implementation. This is the entry point for callers who wish to invoke the share state RPC API.
* Added PersisterStateManager which is used by DefaultStatePersister to manage and send the RPCs over the network.
* Added code to BrokerServer and BrokerMetadataPublisher to instantiate the appropriate persister based on the config value for group.share.persister.class.name. If this is not specified, the DefaultStatePersister will be used. To force use of NoOpStatePersister, set the config to empty. This is an internal config, not to be exposed to the end user. This will be used to factory plug the appropriate persister.
* Using this persister, the internal __share_group_state topic will come to life and will be used for persistence of share group info.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Jun Rao <junrao@gmail.com>, David Arthur <mumrah@gmail.com>
2024-10-28 14:11:04 -04:00
Mickael Maison 6e88c10ed5
KAFKA-14483 Move LocalLog to storage module (#17587)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-28 20:41:46 +08:00
Dmitry Werner 1eb7644349
KAFKA-16845 Migrate ReplicationQuotasTestRig to new test infra (#17089)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-25 03:33:01 +08:00
Stig Døssing 98b7e4deaf
KAFKA-17574 Allow overriding TestKitNodes baseDirectory (#17225)
This allows shutting down a KafkaClusterTestKit from a JVM shutdown hook without risking error logs because the base directory has already been deleted by the shutdown hook TestUtils.tempDirectory sets up.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-25 01:48:25 +08:00
Kuan-Po Tseng 140d35c545
KAFKA-8779 Fix flaky tests introduced by dynamic log levels (#17382)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-24 21:39:35 +08:00
TengYao Chi 553e6b4c6d
KAFKA-17860 Remove log4j-appender module (#17588)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-24 18:13:30 +08:00
Ken Huang 2ff13976ab
KAFKA-17568 Rewrite TestPurgatoryPerformance by Java (#17246)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-24 02:44:37 +08:00
PoAn Yang 8e54a04723
KAFKA-17536; Ensure clear error message when new consumer used with incompatible cluster (#17411)
In Kafka 4.0, by default the consumer uses the updated consumer group protocol defined in KIP-848. When the consumer is used with a cluster that does not support (or is not configured to use) the new protocol, the consumer will get an unfriendly error about unavailable APIs. Since this error could be the user's first impression when attempting to upgrade to 4.0, we need to make sure that the error is very clear about the remediation steps (set the group.protocol to CLASSIC on the client or upgrade and enable the new protocol on the cluster).

Reviewers: Kirk True <ktrue@confluent.io>, David Jacot <djacot@confluent.io>
2024-10-16 01:30:57 -07:00
Sushant Mahajan 5545d717c3
KAFKA-17633: Add share group record formatter and parser. (#17467)
As part of KIP-932, a new internal topic __share_group_state was introduced. There are 2 types of records which are currently being added in this topic - ShareSnapshotKey/Value and ShareUpdateKey/Value
In light of this, we must make the existing tooling like kafka-console-consumer and kafka-dump-log aware of these records for debugging and introspection purposes.
This PR introduces ShareGroupStateMessageFormatter to be used used with kafka-console-consumer and adds an internal class ShareGroupStateMessageParser in DumpLogSegments.scala.
Unit tests have been added to DumpLogSegmentsTest.scala


Reviewers:  Andrew Schofield <aschofield@confluent.io>,  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-10-15 11:44:15 +05:30
Linsiyuan9 76a1af984b
KAFKA-17746 Replace JavaConverters with CollectionConverters (#17451)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-14 17:13:20 +08:00
Chung, Ming-Yen d74f1f847a
KAFKA-17199 Add UT for TransactionLogConfig and TransactionStateManagerConfig (#17442)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-10-12 09:42:54 +08:00
ShivsundarR 374663c64b
KAFKA-17287: Added integration tests for ShareConsumer (#17009)
Reviewers: Andrew Schofield <aschofield@confluent.io>, David Arthur <mumrah@gmail.com>
2024-10-08 10:37:16 -04:00
Federico Valeri 8dbbf5ea76
KAFKA-14705: Move topic filters to tools module (#17387)
After MirrorMaker 1 removal, there are no other modules dependencies for these classes, so we can safely move them to tools module.

Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2024-10-07 16:54:36 +02:00
Dmitry Werner 672c617233
KAFKA-14577: Move ConsoleProducer to tools module (#17157)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Federico Valeri <fedevaleri@gmail.com>
2024-10-07 11:19:59 +02:00
Chia-Ping Tsai f1d6549679
KAFKA-17706 Allow all imports for test-common and test-common-api (#17378)
Reviewers: David Arthur <mumrah@gmail.com>
2024-10-06 14:02:10 +08:00
Bill Bejeck c11a38f9df
KAFKA-17248: KIP-1076 add admin client test helper [1/N] (#17375)
No functional changes, this PR contains a test-helper class for working with AdminClient

Reviewers Matthias Sax <mjsax@apache.org>
2024-10-04 13:58:16 -04:00
Colin Patrick McCabe dbd50ff847
KAFKA-16469: Metadata schema checker (#15995)
Create a schema checker that can validate that later versions of a KRPC schema are compatible with earlier ones.

Reviewers: David Arthur <mumrah@gmail.com>
2024-10-03 12:13:38 -07:00
Chia-Ping Tsai 979740b49d
KAFKA-17589 Move JUnit extensions to test-common module (#17318)
This patch completely removes the compile-time dependency on core for both test and main sources by introducing two new modules.

1) `test-common` include all the common test implementation code (including dependency on :core for BrokerServer, ControllerServer, etc)
2) `test-common:api` new sub-module that just includes interfaces including our junit extension

Reviewers: David Arthur <mumrah@gmail.com>
2024-10-03 10:28:37 +08:00
Chung, Ming-Yen 540fb91103
KAFKA-17258 Migrate AdminFenceProducersIntegrationTest to ClusterTestExtensions framework (#17311)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-10-03 00:47:29 +08:00
Sushant Mahajan 7b7eb6243f
KAFKA-17367: Share coordinator persistent batch merging algorithm. [3/N] (#17149)
This patch introduces a merging algorithm for persistent state batches in the share coordinator. 

The algorithm removes any expired batches (lastOffset before startOffset) and then places the rest in a sorted map. It then identifies batch pairs which overlap and combine them while preserving the relative priorities of any intersecting sub-ranges. The resultant batches are placed back into the map. The algorithm ends when no more overlapping pairs can be found.

Reviewers: Andrew Schofield <aschofield@confluent.io>, David Arthur <mumrah@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>, Jun Rao <junrao@gmail.com>
2024-10-02 11:30:51 -04:00
Omnia Ibrahim 1854d4b8a1
KAFKA-14572: Migrate EmbeddedKafkaCluster used by Streams integration tests from EmbeddedZookeeper to KRaft (#17016)
Migrate the EmbeddedKafkaCluster from the EmbeddedZookeeper to KRaft

Reviewers Bill Bejeck <bbejeck@apache.org>
2024-09-27 15:49:12 -04:00
Dimitar Dimitrov bc47ce1a53
MINOR: Fix a race and add JMH bench for HdrHistogram (#17221) 2024-09-27 23:49:10 +09:00
Apoorv Mittal 05366d2fa7
KAFKA-17626: Move common fetch related classes from storage to server-common (#17289)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>
2024-09-26 20:31:28 -04:00
Matthias J. Sax ce5491b7bf
KAFKA-16331: remove KafkaClientSupplier from StreamsProducer (#17259)
With EOSv1 removed, we don't need to create a producer per task, and thus can simplify the code by removing KafkaClientSupplier from the deeply nested StreamsProducer, to simplify the code.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-09-26 17:07:00 -07:00
xijiu 18340c9733
KAFKA-17563 Move `RequestConvertToJson` to server module (#17223)
Reviewers: Chia-Ping Tsai <chia7712@apache.org>
2024-09-27 02:19:47 +08:00
Apoorv Mittal 6abbd548b8
MINOR Refactoring share fetch code (KIP-932) (#17269)
Reviewers: Andrew Schofield <aschofield@confluent.io>, David Arthur <mumrah@gmail.com>
2024-09-26 08:09:31 -04:00
Sushant Mahajan 67f966f348
KAFKA-17469: Moved share external interfaces to share module. (#17262)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, David Arthur <mumrah@gmail.com>
2024-09-24 12:08:01 -04:00
Mickael Maison f1c011a8b5
KAFKA-14482 Move LogLoader to storage module (#17042)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-17 00:37:49 +08:00
PoAn Yang 98252cae14
KAFKA-16681 Rewrite MiniKDC by Java (#16213)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-14 04:13:40 +08:00
Apoorv Mittal 300e825be7
MINOR Refactored share module classes (#17178)
Reviewers: Andrew Schofield <aschofield@confluent.io>, David Arthur <mumrah@gmail.com>
2024-09-12 13:32:15 -04:00
Abhinav Dixit f466e86bb5
KAFKA-17400: Added share fetch purgatory for delaying share fetch requests (#16969)
Introduced a share fetch purgatory on the broker which delays share fetch requests that cannot be completed instantaneously. Introduced 2 new classes -

DelayedShareFetch - Contains logic to instantaneously complete or force complete a share fetch request on timeout.
DelayedShareFetchKey - Contains the key which can be used to watch the entries within the share fetch purgatory.
ShareFetchUtils - This utility class contains functionalities required for post-processing once the replica manager fetch is completed.
There are many scenarios which can cause a share fetch request to be delayed and multiple scenarios when a delayed share fetch can be attempted to be completed. In this PR, we are only targeting the case when record lock partition limit is reached, the ShareFetch should wait for up to MaxWaitMs for records to be released.

Reviewers: David Arthur <mumrah@gmail.com>, Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>, Jun Rao <junrao@gmail.com>
2024-09-11 11:47:33 -07:00
Sushant Mahajan 821c10157d
KAFKA-17367: Introduce share coordinator [2/N] (#17011)
Introduces the share coordinator. This coordinator is built on the new coordinator runtime framework. It 
is responsible for persistence of share-group state in a new internal topic named "__share_group_state".
The responsibility for being a share coordinator is distributed across the brokers in a cluster. 

Reviewers: David Arthur <mumrah@gmail.com>, Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>
2024-09-09 20:01:24 -04:00
Mickael Maison 839431e591
KAFKA-17468 Move kafka/log/remote/quota classes to storage module (#17074)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-04 02:18:47 +08:00
Kamal Chandraprakash 88b9ff30ad
KAFKA-15859 Introduce remote.list.offsets.request.timeout.ms dynamic config (#17045)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-03 23:06:01 +08:00
Omnia Ibrahim f59d829381
KAFKA-15853 Move TransactionLogConfig and TransactionStateManagerConfig getters out of KafkaConfig (#16665)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-03 18:24:12 +08:00
Mickael Maison c30615e6d7
KAFKA-17430: Move RequestChannel.Metrics/RequestMetrics to server module (#17015)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-03 10:11:47 +02:00
Mickael Maison 1841c07d4a
KAFKA-17449 Move Quota classes to server-common module (#17060)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-31 12:41:34 +08:00
Luke Chen ad4405c8dd
KAFKA-17062: handle dangling "copy_segment_start" state when deleting remote logs (#16959)
The COPY_SEGMENT_STARTED state segments are counted when calculating remote retention size. This causes unexpected retention size breached segment deletion. This PR fixes it by
  1. only counting COPY_SEGMENT_FINISHED and DELETE_SEGMENT_STARTED state segments when calculating remote log size.
  2. During copy Segment, if we encounter errors, we will delete the segment immediately.
  3. Tests added.

Co-authored-by: Guillaume Mallet <>

Reviewers: Kamal Chandraprakash<kamal.chandraprakash@gmail.com>, Satish Duggana <satishd@apache.org>, Guillaume Mallet <>
2024-08-29 14:09:55 +08:00
Mickael Maison b9fe9f532f
KAFKA-16972: Move BrokerTopicStats to storage module (#17003)
Reviewers: Luke Chen <showuon@gmail.com>
2024-08-27 11:39:37 +02:00
DL1231 006af8b939
KAFKA-17327; Add support of group in kafka-configs.sh (#16887)
The patch adds support of alter/describe configs for group in kafka-configs.sh.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>
2024-08-27 02:16:46 -07:00
Sushant Mahajan 1621f88f06
KAFKA-17367: Share coordinator infra classes [1/N] (#16921)
Introduce ShareCoordinator interface and related classes.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>, David Arthur <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-26 10:09:47 -04:00