Commit Graph

14716 Commits

Author SHA1 Message Date
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
TengYao Chi aa22676c48
KAFKA-18425 Remove OffsetTrackingListener (#18443)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-09 00:18:49 +08:00
Andrew Schofield 3f9d2c2db0
KAFKA-18433: Add BatchSize to ShareFetch request (1/N) (#18439)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
2025-01-08 15:29:43 +00:00
Abhinav Dixit b51b31ed9c
KAFKA-18428: Measure share consumers performance (#18415)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-08 14:33:13 +00:00
ShivsundarR 3c7ed3333d
KAFKA-18397: Added null check before sending background event from ShareConsumeRequestManager. (#18419)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-08 13:56:52 +00:00
Andrew Schofield 7436159a27
KAFKA-18449: Add share group state configs to reconfig-server.properties (#18440)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2025-01-08 13:49:46 +00:00
Lianet Magrans 0721d21a57
KAFKA-18415: Fix for event queue metric and flaky test (#18416)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-08 14:31:10 +01:00
Peter Lee 0377e807ff
MINOR: Use Producer interface and ClusterInstance producer factory (#18197)
Reviewers: David Arthur <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 20:53:30 +08:00
Peter Lee 08ef22d888
KAFKA-18173 Remove duplicate `assertFutureError` (#18296)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 20:24:35 +08:00
Mickael Maison d1aa370db8
KAFKA-15599: Move SegmentPosition/TimingWheelExpirationService to raft module (#18094)
Reviewers: Divij Vaidya <diviv@amazon.com>, Jason Taylor <jastaylr@amazon.com>
2025-01-08 12:49:38 +01:00
TaiJuWu 0c435e3855
KAFKA-18353 Remove zk config `control.plane.listener.name` (#18329)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 18:38:37 +08:00
Manikumar Reddy 746ab4dc1e MINOR: Few cleanups 2025-01-08 16:01:40 +05:30
PoAn Yang a97fb662fd
MINOR: add testRestoreCompactedDeletedConnector back to KafkaConfigBackingStoreTest (#18392)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 17:55:48 +08:00
Guang 058f0a94c8
MINOR: Replace deprecated MemberDescription calls in test (#18425)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 17:32:21 +08:00
TengYao Chi 8568157f7f
KAFKA-18443 Remove ZkFourLetterWords (#18429)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 17:24:36 +08:00
Jhen-Yung Hsu f95726a211
KAFKA-18417 Remove controlled.shutdown.max.retries and controlled.shutdown.retry.backoff.ms (#18431)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-08 17:13:42 +08:00