Commit Graph

14731 Commits

Author SHA1 Message Date
TengYao Chi cbbeccad63
MINOR: Remove unnecessary < from Errant Record Reporter section (#18498)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-13 12:13:10 +01:00
Ken Huang 0b60d08d23
KAFKA-18341: Remove KafkaConfig GroupType config check and warn log (#18320)
As ZK mode is being removed for 4.0, we don't need this check anymore.

Reviewers: David Jacot <djacot@confluent.io>
2025-01-13 02:42:17 -08:00
David Jacot 273719227e
KAFKA-18457; Update DumpLogSegments to use coordinator record json converters (#18480)
This patch updates the ShareGroupStateMessageParser and OffsetsMessageParser used by the DumpLogSegments command line tool to use the recently introduced json converters for those records. It basically means that new records are automatically supported.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-13 11:28:54 +01:00
Ken Huang 33556aedc3
KAFKA-18399 Remove ZooKeeper from KafkaApis (6/N): `handleCreateTokenRequest`, `handleRenewTokenRequestZk`, `handleExpireTokenRequestZk` (#18447)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-13 01:42:32 +08:00
Ken Huang 6a8ffe7f64
KAFKA-18399 Remove ZooKeeper from KafkaApis (5/N): ALTER_PARTITION_REASSIGNMENTS, LIST_PARTITION_REASSIGNMENTS (#18464)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-13 01:33:24 +08:00
PoAn Yang 3cf2e45dc4
KAFKA-18399 Remove ZooKeeper from KafkaApis (4/N): OFFSET_COMMIT and OFFSET_FETCH (#18461)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-12 20:54:10 +08:00
TengYao Chi 81b1508acb
KAFKA-18399 Remove ZooKeeper from KafkaApis (3/N): USER_SCRAM_CREDENTIALS (#18456)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-12 20:39:49 +08:00
Xuan-Zhang Gong dbe27c9eb2
KAFKA-18467 enhance the docs of `NewTopic` - the first replica will be treated as the preferred leader (#18470)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-12 20:32:13 +08:00
TengYao Chi b0b54f6db1
KAFKA-18466 Remove log4j-1.2-api from runtime scope while keeping it in distribution package (#18472)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-12 20:15:10 +08:00
Kirk True 403fe71c5f
KAFKA-18400: Don't use YYYY when formatting/parsing dates in Java client (#18404)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-11 18:29:01 +00:00
Xuan-Zhang Gong 1ee715473c
KAFKA-18446 Remove MetadataCacheControllerNodeProvider (#18437)
Reviewers: PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-12 02:12:35 +08:00
Ismael Juma d4aee71e36
KAFKA-18465: Remove MetadataVersions older than 3.0-IV1 (#18468)
Apache Kafka 4.0 will only support KRaft and 3.0-IV1 is the minimum version supported by KRaft. So, we can assume that Apache Kafka 4.0 will only communicate with brokers that are 3.0-IV1 or newer.

Note that KRaft was only marked as production-ready in 3.3, so we could go further and set the baseline to 3.3. I think we should have that discussion, but it made sense to start with the non controversial parts.

Reviewers: Jun Rao <junrao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <david.jacot@gmail.com>
2025-01-11 09:42:39 -08:00
Matthias J. Sax f54cfff1dc
MINOR: simplify producer TX abort error handling (#18486)
Reviewers: Justine Olshan <jolshan@confluent.io>, Jason Gustafson <jason@responsive.dev>
2025-01-10 17:54:40 -08:00
Justine Olshan 32dbbe6a1f
KAFKA-18464: Empty Abort Transaction can fence producer incorrectly with Transactions V2 (#18467)
To avoid self-fencing in the commit/abort + empty abort scenario, return the concurrent transactions error when we have pending state and do the epoch check second. In this scenario, we will complete the previous transaction before proceeding to the empty abort.

Added a test that failed before the change.

Note -- only the pending state is checked earlier. This is because we don’t return from EndTxn (the first commit) until we already written to the log, transitioned to PrepareX, and have the pending CompleteX state. We don't need to worry about the cases of an EndTxn request coming in with PrepareX without the pending state because that would be an older request and/or retry which are already covered.

Reviewers: Artem Livshits <alivshits@confluent.io>, Jeff Kim <jeff.kim@confluent.io>
2025-01-10 16:51:58 -08:00
Matthias J. Sax 0e831d0840
KAFKA-8116: Update Kafka Streams archetype for Java 11 (#18471)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Bill Bejeck <bill@confluent.io>
2025-01-10 15:45:39 -08:00
Matthias J. Sax 3b38b016c8
KAFKA-17825: Update docs for ByteBufferDeserializer changes in 3.6 release (#18466)
KIP-863 introduced a change to ByteBufferDeserializer which is not
properly documented, but should be called out because it could surface
bugs in application code which using ByteBufferDeserializer.

Reviewers:  Lianet Magrans <lmagrans@confluent.io>, Kirk True <ktrue@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 15:32:51 -08:00
Ken Huang cd061c8039
KAFKA-18340: Change Dockerfile to use log4j2 yaml instead log4j properties (#18378)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-10 15:58:39 +01:00
PoAn Yang a7342a2e62
MINOR: fix flaky RemoteLogManagerTest#testStopPartitionsWithDeletion (#18474)
The test has become flakier recently and it's easy to reproduce by running the single test (vs
running the the class test suite).

The root cause is that following functions call `RemoteLogMetadataManager#listRemoteLogSegments`.
It returns iterator. If one of function goes through iterator first, another can't get expected result.
I changed `thenReturn` to `thenAnswer` to avoid the issue.

The race is between:
* RLMExpirationTask#cleanupExpiredRemoteLogSegments
* RemoteLogManager#deleteRemoteLogPartition

Reviewers: Ismael Juma <ismael@juma.me.uk>

Signed-off-by: PoAn Yang <payang@apache.org>
2025-01-10 06:33:10 -08:00
Lucas Brutschy b9a952df6c
KAFKA-18311: Enforcing copartitioned topics (4/N) (#18397)
A simplified port of "CopartitionedTopicsEnforcer" from the client-side to the group coordinator.

This class is responsible for enforcing the number of partitions in copartitioned topics. For each copartition group, it checks whether the number of partitions for all topics in the group is the same, and enforces the right number of partitions for repartition topics whose number of partitions is not enforced by the topology.

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-10 12:31:09 +01:00
David Jacot 87334e6c2e
KAFKA-18308; Update CoordinatorSerde (#18455)
This patch updates the GroupCoordinatorSerde and the ShareGroupCoordinatorSerde to leverage the CoordinatorRecordType to deserialize records. With this, newly added record are automatically picked up. In other words, the serdes work with all defined records without doing anything.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-10 11:17:30 +01:00
PoAn Yang 2b7c039971
KAFKA-18440: Convert AuthorizationException to fatal error in AdminClient (#18435)
Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-10 11:12:28 +01:00
Andrew Schofield c6f2276e32
KAFKA-17671: Create better documentation for transactions (#17454)
Co-authored-by: Matthias J. Sax <mjsax@apache.org>

Reviewers: Matthias Sax <mjsax@apache.org>, Justine Olshan <jolshan@confluent.io>
2025-01-10 09:53:51 +00:00
David Jacot 6cc059dced
KAFKA-18304; Introduce json converter generator (#18458)
This patch introduces json converter generator for the coordinator records. It is not used yet but more patches will follow to make us of them.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 08:07:45 +01:00
Sean Quah fc48b8166b
MINOR: Clean up classic group tests (#18473)
Use `List.of` and `Set.of` where possible.

Reviewers: David Jacot <djacot@confluent.io>
2025-01-09 23:04:45 -08:00
TaiJuWu 5684fc7a2e
KAFKA-18399 Remove ZooKeeper from KafkaApis (2/N): CONTROLLED_SHUTDOWN and ENVELOPE (#18422)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 04:12:12 +08:00
Almog Gavra 2a0c31e768
MINOR: improve StreamThread periodic processing log (#18430)
The current log is really helpful, this PR adds a bit more information to that log to help debug some issues. In particular, it is interesting to be able to debug situations that have long intervals between polls. It also includes a reference to how long it has been since it last logged so you don't have to find the previous time it was logged to compute quick per-second ratios.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2025-01-09 11:01:43 -08:00
Colt McNealy bb22eec478
KAFKA-17455: fix stuck producer when throttling or retrying (#17527)
A producer might get stuck after it was throttled. This PR unblocks the producer by polling again
after pollDelayMs in NetworkUtils#awaitReady().

Reviewers: Matthias J. Sax <matthias@confluent.io>, David Jacot <djacot@confluent.io>
2025-01-09 10:27:04 -08:00
kevin-wu24 25fdcd05fc
KAFKA-17915: Convert remaining Kafka Client system tests to use KRaft (#18367)
Reviewers: Lianet Magrans <lmagrans@confluent.io>
2025-01-09 19:20:34 +01:00
Ao Li ebe7dd2b15
KAFKA-18418: Use CDL to block the thread termination to avoid flaky tests (#18418)
This PR fixed a race-condition in KafkaStreamsTest, by replacing a non-deterministic
sleep with a CountDownLatch to fully control how long a thread blocks.

Reviewers:  David Arthur <mumrah@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2025-01-09 10:19:40 -08:00
Thomas Thornton b35c29401a
KAFKA-18073: Prevent dropped records from failed retriable exceptions (#18146)
Reviewers: Greg Harris <greg.harris@aiven.io>
2025-01-09 10:13:11 -08:00
TaiJuWu 5acbd42dd7
KAFKA-18277 Convert network_degrade_test to Kraft mode (#18247)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 01:49:13 +08:00
Ismael Juma cf7029c026
KAFKA-13093: Log compaction should write new segments with record version v2 (KIP-724) (#18321)
Convert v0/v1 record batches to v2 during compaction even if said record batches would be
written with no change otherwise. A few important details:

1. V0 compressed record batch with multiple records is converted into single V2 record batch
2. V0 uncompressed records are converted into single record V2 record batches
3. V0 records are converted to V2 records with timestampType set to `CreateTime` and the
timestamp is `-1`.
4. The `KAFKA-4298` workaround is no longer needed since the conversion to V2 fixes
the issue too.
5. Removed a log warning applicable to consumers older than 0.10.1 - they are no longer
supported.
6. Added back the ability to append records with v0/v1 (for testing only).
7. The creation of the leader epoch cache is no longer optional since the record version
config is effectively always V2.

Add integration tests, these tests existed before #18267 - restored, modified and
extended them.

Reviewers: Jun Rao <jun@confluent.io>
2025-01-09 09:37:23 -08:00
Peter Lee a116753cc8
KAFKA-17986 Fix ConsumerRebootstrapTest and ProducerRebootstrapTest (#18175)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 01:02:34 +08:00
xijiu fcd98da9ae
KAFKA-18445 Remove LazyDownConversionRecords and LazyDownConversionRecordsSend (#18445)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 00:22:56 +08:00
Ken Huang 307059c770
KAFKA-18399 Remove ZooKeeper from KafkaApis (1/N): `LEADER_AND_ISR`, `STOP_REPLICA`, `UPDATE_METADATA` (#18417)
Delete the handlers for LEADER_AND_ISR, STOP_REPLICA, and UPDATE_METADATA. Also, remove the corresponding unit tests in KafkaApisTest.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-10 00:01:38 +08:00
PoAn Yang 7275dc129e
KAFKA-17730 ReplicaFetcherThreadBenchmark is broken (#18382)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-09 23:47:27 +08:00
Ken Huang 64b8b4a632
MINOR: Remove ZooKeeper mentions in Sanitizer (#18420)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-09 14:33:43 +01:00
Lucas Brutschy 3bda9f817d
KAFKA-18311: Configuring repartition topics (3/N) (#18395)
A simplified port of "RepartitionTopics" 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-09 13:56:37 +01:00
Bruno Cadonna 11459ae7e9
KAFKA-18453: Add StreamsTopology class to group coordinator (#18446)
Adds a class that represent the topology of a Streams group sent by a Streams client in the Streams group heartbeat during initialization to the group coordinator.

This topology representation is used together with the partition metadata on the broker to create a configured topology.

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2025-01-09 13:16:03 +01:00
Swikar Patel 8b72204bfd
KAFKA-15443: Upgrade RocksDB to 9.7.3 (#18275)
This PR upgrades RocksDB from 7.9.2 to 9.7.3 and addresses the following compatibility issues introduced by the RocksDB upgrade:

- Removal of AccessHint: The AccessHint class was completely removed in RocksDB 9.7.3. This required removing all import statements, variable declarations, method parameters, method return types, and static method calls related to AccessHint in RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapterTest.java Unused methods are removed in RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java
- Removal of NO_FILE_CLOSES: The NO_FILE_CLOSES metric was also removed in RocksDB 9.7.3. The calculation for numberOfOpenFiles in RocksDBMetricsRecorder.java has been adjusted to now track the total number of file opens since the last reset. The previous calculation, which subtracted NO_FILE_CLOSES from NO_FILE_OPENS, is no longer possible. The reason RocksDB removed NO_FILE_CLOSES seems to be that it did not properly work: https://github.com/search?q=repo%3Afacebook%2Frocksdb+NO_FILE_CLOSES&type=issues
- Removal of methods related to compressed block cache configuration in BlockBasedTableConfig
- Change of the signature of org.rocksdb.Options.setLogger()

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Matthias J. Sax <matthias@confluent.io>, Bruno Cadonna <cadonna@apache.org>
2025-01-09 11:55:56 +01:00
TengYao Chi 6fa5537ceb
MINOR: Replace ImplicitConversions with CollectionConverters (#18412)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-09 10:00:55 +01:00
Colin Patrick McCabe c28d9a3486
KAFKA-18435 Remove zookeeper dependencies in build.gradle (#18450)
Remove Apache ZooKeeper from the Apache Kafka build. Also remove commons IO, commons CLI, and netty, which were dependencies we took only because of ZooKeeper.

In order to keep the size of this PR manageable, I did not remove all classes which formerly interfaced with ZK. I just removed the ZK types. Fortunately, Kafka generally wrapped ZK data structures rather than using them directly.

Some classes were pretty entangled with ZK, so it was easier just to stub them out. For ZkNodeChangeNotificationListener.scala, PartitionStateMachine.scala, ReplicaStateMachine.scala, KafkaZkClient.scala, and ZookeeperClient.scala, I replaced all the functions with "throw new UnsupportedOperationException". Since the tests for these classes have been removed, as well as the ZK-based broker code, this should be OK as an incremental step.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-09 10:25:17 +08:00
Swikar Patel d1b1d9d47d
KAFKA-18111: Add Kafka Logo to README (#18452)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-01-08 17:17:31 -08:00
David Arthur a6a1c6dd20
MINOR Remove needs-attention label after review (#18366)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 19:35:45 -05:00
Calvin Liu ec49a60e4f
KAFKA-16540: enforce min.insync.replicas config invariants for ELR (#17952)
If ELR is enabled, we need to set a cluster-level min.insync.replicas, and remove all broker-level overrides. The reason for this is that if brokers disagree about which partitions are under min ISR, it breaks the KIP-966 replication invariants. In order to enforce this, when the eligible.leader.replicas.version feature is turned on, we automatically remove all broker-level min.insync.replicas overrides, and create the required cluster-level override if needed. Similarly, if the cluster was created with eligible.leader.replicas.version enabled, we create a similar cluster-level record. In both cases, we don't allow setting overrides for individual brokers afterwards, or removing the cluster-level override.

Split ActivationRecordsGeneratorTest up into multiple test cases rather than having it be one giant test case.

Fix a bug in QuorumControllerTestEnv where we would replay records manually on objects, racing with the active controller thread. Instead, we should simply ensure that the initial bootstrap records contains what we want.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2025-01-08 13:42:25 -08:00
Logan Zhu 5efaae65c6
KAFKA-18432 Remove unused code from AutoTopicCreationManager (#18438)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-09 02:52:28 +08:00
PoAn Yang 4b1b67e3c4
KAFKA-18434: enrich the authorization error message of connecting to controller (#18436)
Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-08 18:56:29 +01:00
TengYao Chi af3f9e3a5a
KAFKA-18426 Remove FinalizedFeatureChangeListener (#18441)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-09 01:24:03 +08:00
Justine Olshan f79d7dc3f4
KAFKA-18035: Readd flaky annotation back for testBumpTransactionalEpochWithTV2Disabled (#18426)
Reviewers: David Jacot <djacot@confluent.io>
2025-01-08 09:06:41 -08:00
Bruno Cadonna 624dd45809
KAFKA-18321: Add StreamsGroupMember, MemberState and Assignment classes (#18276)
* KAFKA-18321: Add StreamsGroupMember, MemberState and Assignment classes

This commit adds the classes to represent a Streams group member in the
consumer coordinator.

Reviewers: Bill Bejeck <bill@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2025-01-08 17:26:41 +01:00