Commit Graph

13323 Commits

Author SHA1 Message Date
xijiu bc031c0410
KAFKA-17121 junit-platform.properties files in published artifacts pollute the test classpath of consumers (#16624)
Reviewers: Andy Wilkinson <ankinson@mastodon.org.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-19 18:18:27 +08:00
Loïc GREFFIER 4de83d38c9
KAFKA-16448: Catch and handle processing exceptions (#16093)
This PR is part of KAFKA-16448 (KIP-1033) which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR actually catches processing exceptions.

Authors:
@Dabz
@sebastienviale
@loicgreffier

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Bruno Cadonna <cadonna@apache.org>
2024-07-19 11:24:25 +02:00
Lianet Magrans 931bb62a23
KAFKA-16984: Complete consumer leave on response to leave request (#16569)
Improvement to ensure that the consumer unsubscribe operation waits for a response to the leave group request before moving on to close the consumer. This makes it consistent with the behaviour of the legacy consumer.

This will avoid undesired interactions on close, that triggers a leave group, and shuts down the network thread when it completes (which before this PR could led to responses to disconnected clients).

Note that this PR does not change the transitions of the state machine on leave group, only the completion of the leave group future.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Kirk True <ktrue@confluent.io>
2024-07-19 10:08:40 +02:00
Chung, Ming-Yen 66655ab49a
KAFKA-17095 Fix the typo from "CreateableTopicConfig" to "CreatableTopicConfig" (#16623)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-19 11:09:08 +08:00
TengYao Chi cd48fa682d
KAFKA-17077 The node.id is inconsistent to broker.id when "broker.id.generation.enable=true". (#16540)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-19 10:41:53 +08:00
Volk 43fdc6ae08
KAFKA-17122 Change the type of `clusterId` from `UUID` to `String` (#16590)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-19 10:37:58 +08:00
xijiu 4fd0f4095e
KAFKA-17118 remove useless code in StorageTool (#16622)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-19 10:04:32 +08:00
brenden20 b4682da5ae
MINOR: Improve ProducerIdExpirationTest (#16619)
The purpose of this PR is to improve upon a test case in ProducerIdExpirationTest.scala. Specifically, the testTransactionAfterTransactionIdExpiresButProducerIdRemains(). This test was slightly flaky. Removed an assertion on the producerState size that caused flakiness in the test

Reviewers: Justine Olshan <jolshan@confluent.io>
2024-07-18 14:39:58 -07:00
Kuan-Po Tseng f595802cc7
KAFKA-16975 The error message of creating `__cluster_metadata` should NOT be "Authorization failed" (#16372)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-18 19:06:45 +08:00
Mickael Maison 7e3dde99d7
MINOR: Various cleanups in raft (#16611)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-18 18:48:29 +08:00
PoAn Yang cf9d517d71
KAFKA-17142 Fix deadlock caused by LogManagerTest#testLogRecoveryMetrics (#16614)
Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-18 18:40:53 +08:00
PoAn Yang 6acc220e03
KAFKA-15773 Group protocol configuration should be validated (#16543)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-18 18:31:36 +08:00
Kuan-Po Tseng 94f5a4f63e
KAFKA-17135 Add unit test for `ProducerStateManager#readSnapshot` and `ProducerStateManager#writeSnapshot` (#16603)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-18 18:23:29 +08:00
PoAn Yang c7c0de3889
KAFKA-17141 'DescribeTopicPartitions API is not supported' warning message confuses users (#16612)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-18 18:00:35 +08:00
Federico Valeri 04d34f3676
KAFKA-17124: Fix flaky DumpLogSegmentsTest#testDumpRemoteLogMetadataNonZeroStartingOffset (#16580)
This changes should fix the flakiness reported for DumpLogSegmentsTest#testDumpRemoteLogMetadataNonZeroStartingOffset.
I was not able to reproduce locally, but the issue was that the second segment was not created in time:

Missing required argument "[files]"

The fix consists of getting the log path directly from the rolled segment.

We were also creating the log twice, and that was producing this warning:

[2024-07-12 00:57:28,368] WARN [LocalLog partition=kafka-832386, dir=/tmp/kafka-2956913950351159820] Trying to roll a new log segment with start offset 0 =max(provided offset = Some(0), LEO = 0) while it already exists and is active with size 0. Size of time index: 873813, size of offset index: 1310720. (kafka.log.LocalLog:70)

This is also fixed.

Reviewers: Luke Chen <showuon@gmail.com>
2024-07-18 10:13:29 +08:00
Xuan-Zhang Gong 9a9eb18beb
MINOR: add docs of "ducker-ak down -f" to e2e README (#16560)
Reviewers: Arnav Dadarya <ardada2468@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-18 08:34:35 +08:00
Greg Harris c97421c100
KAFKA-17150: Use Utils.loadClass instead of Class.forName to resolve aliases correctly (#16608)
Signed-off-by: Greg Harris <greg.harris@aiven.io>
Reviewers: Chris Egerton <chrise@aiven.io>, Chia-Ping Tsai <chia7712@gmail.com>, Josep Prat <josep.prat@aiven.io>
2024-07-17 16:00:45 -07:00
Chris Egerton 53ec055394
KAFKA-17105: Prevent redundant restarts for newly-created connectors (#16581)
Reviewers: Greg Harris <greg.harris@aiven.io>
2024-07-17 14:33:47 -04:00
Dmitry Werner a66a59f427
KAFKA-17148: Remove print MetaPropertiesEnsemble from kafka-storage tool (#16607)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Greg Harris <greg.harris@aiven.io>
2024-07-17 08:16:29 -07:00
Josep Prat ce0a4269c1
MINOR: Improve release script (#16613)
* MINOR: Improve release script
Co-authored-by: Igor Soarez <i@soarez.me>

---------

Signed-off-by: Josep Prat <josep.prat@aiven.io>
Co-authored-by: Igor Soarez <i@soarez.me>

Reviewers: Igor Soarez <soarez@apple.com>
2024-07-17 16:45:32 +02:00
Abhijeet Kumar 24ed31739e
KAFKA-16853: Split RemoteLogManagerScheduledThreadPool (#16502)
As part of KIP-950, we want to split the RemoteLogManagerScheduledThreadPool into separate thread pools (one for copy and another for expiration). In this change, we are splitting it into three thread pools (one for copy, one for expiration, and another one for follower). We are reusing the same thread pool configuration for all three thread pools. We can introduce new user-facing configurations later.

Reviewers: Kamal Chandraprakash<kamal.chandraprakash@gmail.com>, Luke Chen <showuon@gmail.com>, Christo Lolov <lolovc@amazon.com>, Satish Duggana <satishd@apache.org>
2024-07-17 16:43:23 +05:30
Chris Egerton 177b38ad66
KAFKA-16383: Ensure tasks have already polled their consumers before producing verified records in MirrorConnectorsIntegrationBaseTest::testReplicateFromLatest (#16598)
Reviewers: Greg Harris <greg.harris@aiven.io>
2024-07-16 19:42:31 -04:00
PoAn Yang b015a83f6d
KAFKA-17017 AsyncKafkaConsumer#unsubscribe clean the assigned partitions (#16449)
Reviewers: Lianet Magrans <lianetmr@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-17 04:18:33 +08:00
Colin Patrick McCabe 4e66836ca0
MINOR: fix JavaDoc error in SupportedVersionRange.java (#16605)
Reviewers: José Armando García Sancio <jsancio@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-17 04:12:53 +08:00
Zhengke Zhou 6cffed56f6
KAFKA-16943: Synchronously verify Connect worker startup failure in InternalTopicsIntegrationTest (#16451)
Reviewers: Chris Egerton <chrise@aiven.io>
2024-07-16 14:20:44 -04:00
Alyssa Huang d0f71486c2
MINOR: Improve the logging of IllegalStateException exceptions thrown from SslFactory (#16346)
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Rajini Sivaram <rajinisivaram@googlemail.com>
2024-07-16 11:01:53 -07:00
Colin Patrick McCabe 4d3e366bc2
KAFKA-16772: Introduce kraft.version to support KIP-853 (#16230)
Introduce the KRaftVersion enum to describe the current value of kraft.version. Change a bunch of places in the code that were using raw shorts over to using this new enum.

In BrokerServer.scala, fix a bug that could cause null pointer exceptions during shutdown if we tried to shut down before fully coming up.

Do not send finalized features that are finalized as level 0, since it is a no-op.

Reviewers: dengziming <dengziming1993@gmail.com>, José Armando García Sancio <jsancio@apache.org>
2024-07-16 09:31:10 -07:00
Mason Chen e1bf155270
KAFKA-17055; Use random replica ids in kraft protocol tests
All of the tests in KafkakRaftClientTest and KafkaRaftClientSnapshotTest use well known ids like 0, 1, etc. Because of this those tests were not able to catch a bug in the BeginQuorumEpoch schema were the default value for VoterId was 0 instead of -1.

Improve those tests by using random valid replica id to lower the probability that the replica id will match the default value of the schema.

Reviewers: José Armando García Sancio <jsancio@apache.org>
2024-07-16 11:33:32 -04:00
Andrew Schofield 1e16e16f64
KAFKA-16730: Initial version of share group consumer client code (#16461)
This is the initial version of the share group consumer client code. It implements the complete ShareConsumer interface.

There are unit tests, but not integration tests yet since those would depend upon complete broker code, which is not available at this point.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>,  Lianet Magrans <lianetmr@gmail.com>
2024-07-16 16:45:38 +05:30
Demonic 43235c2796
KAFKA-17133 add unit test to make sure `ConsumerRecords#recoreds` returns immutable object (#16588)
Reviewers: TingIāu "Ting" Kì <kitingiao@gmail.com>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-16 17:05:13 +08:00
Lee Dongjin df5cc4a064
KAFKA-17073 Deprecate ReplicaVerificationTool (#16572)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-16 16:57:45 +08:00
vamossagar12 808498e939
KAFKA-14401: Fail kafka log read end requests if underneath work thread fails (#14372)
Reviewers: Chris Egerton <chrise@aiven.io>
2024-07-15 20:55:52 -04:00
dujian0068 79ab5074e7
MINOR: Remove redundant </div> from config-streams.html (#16577)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-16 05:33:23 +08:00
Ken Huang 20ee83c462
KAFKA-17102 FetchRequest#forgottenTopics would return incorrect data (#16557)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-16 05:12:43 +08:00
Mickael Maison dceda5e647
MINOR: Don't include checker-qual in distribution (#16578)
Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Satish Duggana <satishd@apache.org>
2024-07-15 17:39:38 +02:00
Apoorv Mittal 3a442ffe32
KAFKA-16743,KAFKA-16744: KafkaApis support for share group heartbeat and describe (#16574)
Added handling of share group heartbeat and describe in KafkaApis. The Implementation of heartbeat and describe is with group coordinator.

Reviewers:  Manikumar Reddy <manikumar.reddy@gmail.com>, Rahul <rahul.nirgude@mastercard.com>
2024-07-15 19:06:20 +05:30
David Arthur 8aee314a46
KAFKA-16667 Avoid stale read in KRaftMigrationDriver (#15918)
When becoming the active KRaftMigrationDriver, there is another race condition similar to KAFKA-16171. This time, the race is due to a stale read from ZK. After writing to /controller and /controller_epoch, it is possible that a read on /migration is not linearized with the writes that were just made. In other words, we get a stale read on /migration. This leads to an inability to sync metadata to ZK due to incorrect zkVersion on the migration ZNode.

The non-linearizability of reads is in fact documented behavior for ZK, so we need to handle it.

To fix the stale read, this patch adds a write to /migration after updating /controller and /controller_epoch. This allows us to learn the correct zkVersion for the migration ZNode before leaving the BECOME_CONTROLLER state.

This patch also adds a check on the current leader epoch when running certain events in KRaftMigrationDriver. Historically, we did not include this check because it is not necessary for correctness. Writes to ZK are gated on the /controller_epoch zkVersion, and RPCs sent to brokers are gated on the controller epoch. However, during a time of rapid failover, there is a lot of processing happening on the controller (i.e., full metadata sync to ZK and full UMRs sent to brokers), so it is best to avoid running events we know will fail.

There is also a small fix in here to improve the logging of ZK operations. The log message are changed to past tense to reflect the fact that they have already happened by the time the log message is created.

Reviewers: Igor Soarez <soarez@apple.com>
2024-07-15 09:32:06 -04:00
xijiu f749af557a
MINOR: add some unit test for common Utils (#16549)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-15 21:18:51 +08:00
Apoorv Mittal 0b6086ed88
KAFKA-16741: Add ShareGroupHeartbeat API support - 2/N (KIP-932) (#16573)
ShareGroupHeartbeat API support as defined in KIP-932. The heartbeat persists Group and Member information on __consumer_offsets topic.

The PR also moves some of the ShareGroupConfigs to GroupCoordinatorConfigs as they should only be used in group coordinator.


Reviewers: Andrew Schofield <aschofield@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>
2024-07-15 16:14:55 +05:30
Volk 15eb555b03
MINOR: Fix the typo in RaftEventSimulationTest.java and ControllerNode.java (#16591)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-15 18:15:22 +08:00
PoAn Yang 6e9c039eea
KAFKA-17097 Add replace.null.with.default configuration to ValueToKey and ReplaceField (#16571)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-15 18:12:59 +08:00
Vinay Agarwal 4cec840baf
KAFKA-16661: Added a lower `log.initial.task.delay.ms` value (#16221)
added a lower log.initial.task.delay.ms value to integration test framework to 500ms

Reviewers: Luke Chen <showuon@gmail.com>
2024-07-15 17:06:54 +08:00
PoAn Yang 2cf1ef99d7
KAFKA-17129 Revisit FindCoordinatorResponse in KafkaConsumerTest (#16589)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-15 08:17:53 +08:00
Matthias J. Sax a9b2b36908
MINOR: Add more debug logging to EOSUncleanShutdownIntegrationTest (#16490)
Reviewers: Bruno Cadonna <bruno@confluent.io>
2024-07-14 10:28:31 -07:00
PoAn Yang e104974b74
KAFKA-17110 Enable valid test case in KafkaConsumerTest for AsyncKafkaConsumer (#16566)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-14 09:27:41 +08:00
TaiJuWu 75075002b5
KAFKA-17106 enable testFetchProgressWithMissingPartitionPosition for AsyncConsumer (#16564)
Reviewers: PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-14 09:04:20 +08:00
Chris Egerton 83081652ab
MINOR: Fix ConnectWorkerIntegrationTest::testBrokerCoordinator (#16585)
Reviewers: Greg Harris <greg.harris@aiven.io>
2024-07-13 03:48:19 -04:00
Alyssa Huang 7495e70365
KAFKA-16532; Support for first leader bootstrapping the voter set (#16518)
The first leader of a KRaft topic partition must rewrite the content of the bootstrap checkpoint (0-0.checkpoint) to the log so that it is replicated. Bootstrap checkpoints are not replicated to the followers.

The control records for KRaftVersionRecord and VotersRecord in the bootstrap checkpoint will be written in one batch along with the LeaderChangeMessage. The leader will write these control records before accepting data records from the state machine (Controller).

The leader determines that the bootstrap checkpoint has not been written to the log if the latest set of voters is located at offset -1. This is the last contained offset for the bootstrap checkpoint (0-0.checkpoint).

This change also improves the RaftClientTestContext to allow for better testing of the reconfiguration functionality. This is mainly done by allowing the voter set to be configured statically or through the bootstrap checkpoint.

Reviewers: José Armando García Sancio <jsancio@apache.org>, Colin P. McCabe <cmccabe@apache.org>
Co-authors: José Armando García Sancio <jsancio@apache.org>
2024-07-12 13:44:21 -07:00
Xuan-Zhang Gong 0ada8fac68
KAFKA-17096 Fix kafka_log4j_appender.py (#16559)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-12 22:35:55 +08:00
Okada Haruki 01cf24a1ca
KAFKA-17061 Improve the performance of isReplicaOnline (#16529)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-12 12:52:59 +08:00