Commit Graph

5506 Commits

Author SHA1 Message Date
David Jacot 256ccd0c0d
KAFKA-18487; Remove ReplicaManager#stopReplicas (#18647)
This patch removes `ReplicaManager#stopReplicas`. I have ensured that removed unit tests are covered by other existing tests or are updated to use kraft.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-21 11:47:16 +01:00
Dimitar Dimitrov 31d8e68ed1
KAFKA-18583; Fix getPartitionReplicaEndpoints for KRaft (#18635)
Although `MetadataCache`'s `getPartitionReplicaEndpoints` takes a single topic-partition, the `KRaftMetadataCache` implementation iterates over all partitions of the matching topic. This is not necessary and can cause significant performance degradation when the topic has a relatively high number of partitions.

Note that this is not a recent regression - it has been a part of `KRaftMetadataCache` since its creation.

Reviewers: Ismael Juma <ismael@juma.me.uk>, David Jacot <djacot@confluent.io>
2025-01-21 10:51:59 +01:00
David Jacot 76bf38a4fd
KAFKA-18604; Update transaction coordinator (#18636)
This patch updates the transaction coordinator record to use the new coordinator record definition.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-21 08:36:23 +01:00
Ismael Juma 87b37a4065
KAFKA-14552: Assume a baseline of 3.0 for server protocol versions (#18497)
Kafka 4.0 will remove support for zk mode and will require conversion to kraft
before upgrading to 4.0. The minimum kraft version is 3.0 (aka 3.0-IV1).

This provides an opportunity to remove exclusively server side protocols versions
that only exist to allow direct upgrades from versions older than 3.0 or that are
used only by zk mode.

Since KRaft became production ready in 3.3, we should consider setting the
baseline to 3.3. But that requires more discussion and it can be done via a
separate change (KAFKA-18601).

Protocol changes:
* Remove RequestHeader v0 (only used by ControlledShutdown v0)
* Remove WriteTxnMarkers v0
* Remove all versions of ControlledShutdown, LeaderAndIsr, StopReplica, UpdateMetadata

In order to remove all versions safely, extend generator to support setting
"versions" to "none". In this case, we no longer generate the `*Data` classes,
but we still reserve the id for the relevant protocol api (so it doesn't get
accidentally used for something else). The protocol documentation is correct
after these changes.

We kept a simplified version of `LeaderAndIsr{Request|Response}` because
it's used by many tests that are still relevant in kraft mode. Once
KAFKA-18486 is done, it may be possible to remove it (I left a comment on
the ticket). Similarly, KAFKA-18487 may make it possible to remove
the introduced `StopReplicaPartitionState` (left a comment on that ticket too).

There are a number of places that were adjusted to include an
`ApiKeys.hasValidVersion` check.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-20 13:51:44 -08:00
TengYao Chi 837fb1ed02
MINOR: Remove unused QuotaConfgHandler (#18617)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-21 03:02:42 +08:00
TengYao Chi f1ee0557f8
MINOR: Remove zk related statement from ControllerConfigurationValidator (#18637)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-20 17:10:24 +01:00
Ken Huang 892a446789
KAFKA-18594: Cleanup BrokerLifecycleManager (#18626)
Reviewers: Christo Lolov <lolovc@amazon.com>
2025-01-20 15:17:57 +00:00
Ken Huang 71495a2013
KAFKA-18568: Fix flaky test ClientIdQuotaTest (#18612)
The reason for flakiness is PR #18080 which modifies the linger.ms config from 0 to 5. ClientIdQuotaTest are testing "Low enough quota that a producer sending a small payload in a tight loop should get throttled", thus this config change Influence this test scenario.

This commits uses the older value of 0ms for linger.ms for ClientIdQuotaTest tests.

Reviewers: Ismael Juma <ismael@juma.me.uk>, TaiJuWu <tjwu1217@gmail.com>, Divij Vaidya <diviv@amazon.com>
2025-01-20 16:05:47 +01:00
TengYao Chi a842c02b88
KAFKA-18553: Update javadoc and comments of ConfigType (#18567)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <amittal@confluent.io>
2025-01-20 15:20:36 +01:00
Sanskar Jhajharia bcbc72e29b
[KAFKA-16720] AdminClient Support for ListShareGroupOffsets (1/n) (#18571)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-01-20 07:47:14 +00:00
Ken Huang 96499029b7
KAFKA-18588 Remove TopicKey.scala (#18624)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-20 10:30:14 +08:00
TaiJuWu 20e616ecc1
KAFKA-18578: Remove `UpdateMetadataRequest` from `MetadataCacheTest` (#18628)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-19 12:18:43 -08:00
Ken Huang c044eb61a1
KAFKA-18593 Remove ZkCachedControllerId In MetadataCache (#18625)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-19 10:15:06 -08:00
TengYao Chi 697cf641bc
KAFKA-17668: Clean-up LogCleaner#maxOverCleanerThreads and LogCleanerManager#maintainUncleanablePartitions (#17390)
Since maxOverCleanerThreads does not have a corresponding unit test,
I have added a unit test for it. maintainUncleanablePartitions has been
thoroughly tested in tests, so I simply replaced the old implementation
with the new one.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-19 07:21:52 -08:00
Ken Huang 3082a85e0e
MINOR: Remove KafkaApis unused method (#18620)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-19 22:45:22 +08:00
Ken Huang 516d5240b9
KAFKA-18429 Remove ZkFinalizedFeatureCache and StateChangeFailedException (#18616)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-19 19:13:47 +08:00
TengYao Chi 485d36d3b3
KAFKA-18589 Remove unused interBrokerProtocolVersion from GroupMetadataManager (#18619)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-19 18:59:24 +08:00
Ken Huang eb1c8419aa
KAFKA-18516 Remove RackAwareMode (#18598)
Reviewers: TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-19 18:49:12 +08:00
Ken Huang ce5d7be1dc
KAFKA-18492 Cleanup RequestHandlerHelper (#18608)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-19 18:41:41 +08:00
Ken Huang bb3944c1d0
KAFKA-18427: Remove ZooKeeperClient (#18613)
Reviewers: Ismael Juma <ismael@juma.me.uk, TingIāu "Ting" Kì <51072200+frankvicky@users.noreply.github.com>
2025-01-18 21:14:46 -08:00
TaiJuWu 4772805cd5
KAFKA-18540: Remove `UpdataMetadataRequest` from `KafkaApisTest` (#18591)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-18 21:12:52 -08:00
Ken Huang 6eddaeba58
KAFKA-18532: Clean Partition.scala zookeeper logic (#18594)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-18 17:54:06 -08:00
TaiJuWu ff3de0cedc
MINOR: restore testUnauthorizedTopicMetadataRequest (#18578)
This was removed during removal of zk code (#18542), but
we should instead convert it to work with kraft.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-18 17:34:10 -08:00
PoAn Yang 85ec8b50c8
KAFKA-18423: Remove ZkData and related unused references (#18605)
Also removed:

* ZkNodeChangeNotificationListener
* KafkaZkClient

Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-18 17:07:42 -08:00
TengYao Chi 029d9184c6
KAFKA-18565 Cleanup SaslSetup (#18586)
Reviewers: Christo Lolov <lolovc@amazon.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-19 03:14:59 +08:00
Ken Huang a814e21da8
KAFKA-18430 Remove ZkNodeChangeNotificationListener (#18606)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-19 01:34:30 +08:00
PoAn Yang e124d3975b
KAFKA-806: Index may not always observe log.index.interval.bytes (#18012)
Currently, each log.append() will add at most 1 index entry, even when the appended data is larger than log.index.interval.bytes. One potential issue is that if a follower restarts after being down for a long time, it may fetch data much bigger than log.index.interval.bytes at a time. This means that fewer index entries are created, which can increase the fetch time from the consumers.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Jun Rao <junrao@gmail.com>
2025-01-17 11:51:05 -08:00
Ken Huang a6faec179a
KAFKA-18515 Remove DelegationTokenManagerZk (#18595)
Reviewers: TengYao Chi <kitingiao@gmail.com>, Christo Lolov <lolovc@amazon.com>
2025-01-17 16:47:33 +00:00
Ismael Juma 3996e90ff7
Remove casts to KRaftMetadataCache (#18579)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-17 07:09:34 -08:00
Alyssa Huang 4583b033f0
KAFKA-17642: PreVote response handling and ProspectiveState (#18240)
This PR implements the second part of KIP-996 and KAFKA-16164 (tasks KAFKA-16607, KAFKA-17642, KAFKA-17643, KAFKA-17675) which encompass the response handling of PreVotes, addition of new ProspectiveState, update to metrics, and addition of Raft simulation tests.

Voters now transition to ProspectiveState first before CandidateState to prevent unnecessary epoch bumps. Voters in ProspectiveState send PreVotes requests which are Vote requests with PreVote set to true.

Follower grants PreVotes if it has not yet fetched successfully from leader. Leader denies all PreVotes. Unattached, Prospective, Candidate, and Resigned will grant PreVotes if the requesting replica's log is at least as long as theirs. Granted PreVotes are not persisted like standard votes. It is possible for a voter to grant several PreVotes in the same epoch.

The only state which is allowed to transition directly to CandidateState is ProspectiveState. This happens on reception of majority of granted PreVotes or if at least one voter doesn't support PreVote requests.

Prospective will transition to Follower after election loss/timeout if it was already aware of last known leader and the leader's endpoint, or at any point if it discovers the leader.

Prospective will transition to Unattached after election loss/timeout if it does not know the leader endpoints.

After electionTimeout, Resigned now always transitions to Unattached and increases the epoch.

Prospective grants standard votes if it has not already granted a standard vote (no votedKey), has no leaderId, and the recipient's log is current enough

Candidate no longer backs off after election timeout. Candidate still backs off after election loss.

Reviewers: José Armando García Sancio <jsancio@apache.org>
2025-01-17 09:38:03 -05:00
TengYao Chi 3191fe56fc
KAFKA-18413: Remove AdminZkClient (#18585)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-17 15:10:31 +01:00
PoAn Yang 5a1fb1588d
KAFKA-18373: Remove ZkMetadataCache (#18553)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2025-01-17 11:49:11 +01:00
PoAn Yang 0e502e0b47
KAFKA-18431: Remove KafkaController (#18573)
Remove KafkaController and related unused references:

* ControllerChannelContext
* ControllerChannelManager
* ControllerEventManager
* ControllerState
* PartitionStateMachine
* ReplicaStateMachine
* TopicDeletionManager
* ZkBrokerEpochManager

Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-16 18:56:05 -08:00
Kirk True 4f0a91393c
KAFKA-17623: Flaky testSeekPositionAndPauseNewlyAssignedPartitionOnPartitionsAssignedCallback (#18515)
Reviewers: Lianet Magrans <lmagrans@confluent.io>
2025-01-16 22:02:23 +01:00
Ken Huang cabbb613a2
KAFKA-18407: Remove ZkAdminManager, DelayedCreatePartitions, CreatePartitionsMetadata, ZkConfigRepository, DelayedDeleteTopics (#18574)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-16 19:32:22 +01:00
TengYao Chi 60cc2a0dea
KAFKA-18556: Remove JaasModule#zkDigestModule, JaasTestUtils#zkSections (#18568)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-16 18:17:06 +01:00
Mickael Maison 6eb44ad869
KAFKA-14485: Move LogCleaner exceptions to storage module (#18534)
Reviewers: Luke Chen <showuon@gmail.com>, Ken Huang <s7133700@gmail.com>
2025-01-16 17:26:29 +01:00
Jason Taylor 54fe0f0135
KAFKA-16368: Add a new constraint for segment.bytes to min 1MB for KIP-1030 (#18140)
Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-16 16:07:00 +01:00
TengYao Chi 724cf84de9
MINOR: Replace deprecated RichOptional.asScala with toScala (#18529)
Reference: https://www.scala-lang.org/api/2.13.0/scala/jdk/OptionConverters$$RichOptional.html

Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-16 06:32:49 -08:00
Jason Taylor 23c459286b
KAFKA-16368: Update defaults for LOG_MESSAGE_TIMESTAMP_AFTER_MAX_MS_DEFAULT and NUM_RECOVERY_THREADS_PER_DATA_DIR_CONFIG (#18106)
Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-16 15:30:00 +01:00
Ken Huang ce1b079884
KAFKA-18542 Cleanup AlterPartitionManager (#18552)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-16 19:50:02 +08:00
Ken Huang 762bbcb711
KAFKA-18406 Remove ZkBrokerEpochManager.scala (#18561)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-16 19:35:09 +08:00
PoAn Yang 25f2ed090a
KAFKA-18405 Remove ZooKeeper logic from DynamicBrokerConfig (#18508)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-16 19:23:59 +08:00
Jason Taylor 11c10fe4da
KAFKA-16368: Update default linger.ms to 5ms for KIP-1030 (#18080)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Divij Vaidya <diviv@amazon.com>
2025-01-16 10:50:06 +01:00
PoAn Yang 14daa23b59
KAFKA-18331: Make process.roles and node.id required configs (#18414)
In 4.0, there is no ZK mode and both of these configs are required in kraft mode.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-15 23:55:51 -08:00
Chung, Ming-Yen 60d08a7abb
KAFKA-18552: Remove unnecessary version check in testHandleOffsetFetch* (#18559)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-15 19:39:19 -08:00
Ken Huang b9ccab42fe
KAFKA-18472: Remove MetadataSupport (#18483)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-15 19:38:33 -08:00
Dmitry Werner 92fd99bda1
KAFKA-18479: Remove keepPartitionMetadataFile in UnifiedLog and LogMan… (#18491)
Reviewers: Jun Rao <junrao@gmail.com>
2025-01-15 13:59:28 -08:00
Apoorv Mittal 3fa998475b
KAFKA-18539 Remove optional managers in KafkaApis (#18550)
Removed Optional for SharePartitionManager and ClientMetricsManager as zookeeper code is being removed. Also removed asScala and asJava conversion in KafkaApis.handleListClientMetricsResources, moved to java stream.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-16 04:46:05 +08:00
Sushant Mahajan 47f22faac3
MINOR: Added flaky references for a few tests. (#18558)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-15 19:24:52 +00:00