Commit Graph

14899 Commits

Author SHA1 Message Date
David Jacot 80d2a8a42d
KAFKA-18616; Refactor DumpLogSegments's MessageParsers (#18688)
All the work that we have done to automate and to simplify the coordinator records allows us to simplify the related MessageParsers in DumpLogSegments. They can all share the same based implementation. This is nice because it ensures that we handle all those records similarly.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-24 04:59:30 -08:00
Okada Haruki 17846fe743
KAFKA-16372 Fix producer doc discrepancy with the exception behavior (#15574)
Currently, Producer.send doc is inconsistent with actual exception behavior
      - TimeoutException: This won't be thrown from send on buffer-full or metadata-missing actually. Instead, it will returned as failed future.
       - AuthenticationException/AuthorizationException: These exceptions are also won't be thrown. Returned with failed future actually.
Fixed Callback javadoc and ProducerConfig doc as well.

Reviewers: Luke Chen <showuon@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-01-24 20:23:43 +08:00
TengYao Chi 5d81fe20c8
KAFKA-18590 Cleanup DelegationTokenManager (#18618)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-24 20:12:03 +08:00
TengYao Chi fa2df3bca7
KAFKA-18559 Cleanup FinalizedFeatures (#18593)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-24 19:39:01 +08:00
Logan Zhu 356f0d815c
KAFKA-18597 Fix max-buffer-utilization-percent is always 0 (#18627)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-24 18:21:34 +08:00
TengYao Chi 66868fc1fa
KAFKA-18620: Remove UnifiedLog#legacyFetchOffsetsBefore (#18686)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-24 11:11:05 +01:00
Matthias J. Sax ad79b4afa7
MINOR: cleanup ProcessorContextImplTest (#18682)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-01-23 17:27:14 -08:00
TengYao Chi 40890faa1b
KAFKA-18592 Cleanup ReplicaManager (#18621)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Christo Lolov <lolovc@amazon.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-24 01:34:36 +08:00
TaiJuWu ce4eeaa379
MINOR: restore `testGetAllTopicMetadataShouldNotCreateTopicOrReturnUnknownTopicPartition` (#18633)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-24 01:27:18 +08:00
Sushant Mahajan 01afba8fdb
MINOR: Refactor ShareConsumerTest to use ClusterTestExtensions. (#18656)
Reviewers: ShivsundarR <shr@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-01-23 16:35:33 +00:00
Lucas Brutschy aea699bdef
KAFKA-18324: Add CurrentAssignmentBuilder (#18476)
Implements the current assignment builder, analogous to the current assignment builder of consumer groups. The main difference is the underlying assigned resource, and slightly different logic around process IDs: We make sure to move a task only to a new client, once the task is not owned anymore by any client with the same process ID (sharing the same state directory) - in any role (active, standby or warm-up).

Compared to the feature branch, the main difference is that I refactored the separate treatment of active, standby and warm-up tasks into a compound datatype called TaskTuple (which is used in place of the more specific Assignment class). This also has effects on StreamsGroupMember.

Reviewers: Bruno Cadonna <cadonna@apache.org>, Bill Bejeck <bbejeck@apache.org>
2025-01-23 17:35:03 +01:00
Ken Huang 7e46087570
MINOR: rename `resendBrokerRegistrationUnlessZkMode` to `resendBrokerRegistration` (#18645)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-24 00:33:05 +08:00
Karsten Spang 400ecab518
KAFKA-13810: Document behavior of KafkaProducer.flush() w.r.t callbacks (#12042)
Reviewers: Luke Chen <showuon@gmail.com>, Andrew Eugene Choi <andrew.choi@uwaterloo.ca>
2025-01-23 17:20:30 +01:00
Sean Quah 5946f27ac5
KAFKA-18484 [2/2]; Handle exceptions during coordinator unload (#18667)
Ensure that unloading a coordinator always succeeds. Previously, we have
guarded against exceptions from DeferredEvent completions. All that
remains is handling exceptions from the onUnloaded() method of the
coordinator state machine.

Reviewers: David Jacot <djacot@confluent.io>
2025-01-23 17:15:21 +01:00
Andrew Schofield 8000d04dcb
KAFKA-18488: Additional protocol tests for share consumption (#18601)
Reviewers: ShivsundarR <shr@confluent.io>, Lianet Magrans <lmagrans@confluent.io>
2025-01-23 13:32:59 +00:00
TengYao Chi bdc92fd5a1
MINOR: Cleanup zk condition in TransactionsTest, QuorumTestHarness and PlaintextConsumerAssignorsTest (#18639)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-23 19:53:10 +08:00
qingbozhang a783dc69b9
MINOR: Replace Stream#collect with Stream#toList api from JDK 16 (#18655)
Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-23 12:15:41 +01:00
Pramithas Dhakal 27552e7b11
MINOR: Make `forceUnmap` method protected (#18638)
Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-23 11:39:45 +01:00
David Jacot bc807083fb
KAFKA-18486; [1/2] Update LocalLeaderEndPointTest (#18666)
This patch is a first step towards removing `ReplicaManager#becomeLeaderOrFollower`. It updates the `LocalLeaderEndPointTest` tests.

Reviewers: Christo Lolov <lolovc@amazon.com>, Ismael Juma <ismael@juma.me.uk>
2025-01-23 10:49:16 +01:00
Ken Huang 32767599c0
MINOR: add the removed topic metrics to zk2kraft (#18658)
Reviewers: Christo Lolov <lolovc@amazon.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-23 15:05:06 +08:00
Justine Olshan 94a1bfb128
KAFKA-18575: Transaction Version 2 doesn't correctly handle race condition with completing and new transaction(#18604)
There is a subtle race condition with transactions V2 if a transaction is still completing when checking if we need to add a partition, but it completes when the request reaches the coordinator.

One approach was to remove the verification for TV2 and just check the epoch on write, but a simpler one is to simply return concurrent transactions from the partition leader (before attempting to add the partition). I've done this and added a test for this behavior.

Locally, I reproduced the race but adding a 1 second sleep when handling the WriteTxnMarkersRequest and a 2 second delay before adding the partition to the AddPartitionsToTxnManager. Without this change, the race happened on every second transaction as the first one completed. With this change, the error went away.

As a followup, we may want to clean up some of the code and comments with respect to verification as the code is used by both TV0 + verification and TV2. But that doesn't need to complete for 4.0. This does :)

Reviewers: Jeff Kim <jeff.kim@confluent.io>, Artem Livshits <alivshits@confluent.io>, Calvin Liu <caliu@confluent.io>
2025-01-22 13:44:08 -08:00
Lianet Magrans 410065a65d
KAFKA-18517: Enable ConsumerBounceTest to run for new async consumer (#18532)
Reviewers: Andrew Schofield <aschofield@confluent.io>, Kirk True <ktrue@confluent.io>
2025-01-22 18:02:38 +01:00
Xiaobing Fang f4d90398cc
MINOR: Fix `LogCleanerManagerTest.testLogsUnderCleanupIneligibleForCompaction()` for `LogMessageTimestampType = "LogAppendTime"` (#12333)
While setting Defaults.LogMessageTimestampType to "LogAppendTime", `LogCleanerManagerTest.testLogsUnderCleanupIneligibleForCompaction()` fails with a InvalidTimestampException.

This PR fixes this by regenerating the records instead of previous approach of re-using same records in the test.

Reviewers: Divij Vaidya <diviv@amazon.com>, Kvicii <kvicii.yu@gmail.com>

---------

Co-authored-by: fangxiaobing <fangxiaobing@kuaishou.com>
2025-01-22 17:50:39 +01:00
Ken Huang 341e535942
KAFKA-18519: Remove Json.scala, cleanup AclEntry.scala (#18614)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-22 16:12:06 +01:00
Chung, Ming-Yen 084fcbd327
KAFKA-18599: Remove Optional wrapping for forwardingManager in ApiVersionManager (#18630)
`forwardingManager` is always present now.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2025-01-22 06:50:16 -08:00
TengYao Chi 7e86bd8281
KAFKA-18229: Move configs out of "kraft" directory (#18389)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Ismael Juma <ismael@juma.me.uk>, José Armando García Sancio <jsancio@apache.org>
2025-01-22 15:47:57 +01:00
Sean Quah 5a57473a52
KAFKA-18484 [1/N]; Handle exceptions from deferred events in coordinator (#18661)
Guard against the coordinator getting stuck due to deferred events
throwing exceptions.

Reviewers: David Jacot <djacot@confluent.io>
2025-01-22 14:46:19 +01:00
Andrew Schofield 9da516b1a9
KAFKA-18392: Ensure client sets member ID for share group (#18649)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Lianet Magrans <lmagrans@confluent.io>
2025-01-22 08:57:40 +00:00
Bruno Cadonna 239708f52e
KAFKA-18518: Add processor to handle rebalance events (#18527)
This commit adds a processor named
StreamsRebalanceEventsProcessor that handles the rebalance
events sent from the background thread of the async
consumer to the stream thread when an task
assignment changes. It also adds the corresponding rebalance
events.

Additionally, this commit adds StreamsRebalanceData that
maintains the data that is exchanges for the Streams rebalance
protocol.

All of these are used by the Streams heartbeat request manager
and the Streams membership manager that will be added in a future
commit.

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2025-01-22 08:30:56 +01:00
TengYao Chi a3da6bbb0c
MINOR: Cleanup ControllerCOntext and StateChangeLogger (#18588)
These methods were previously invoked by ZK components, but we have just removed them.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-21 18:41:17 -08:00
Dmitry Werner eb1a1fc7c8
MINOR: Remove recordVersion param from javadoc (#18603)
In commit af233f6e6dbc2b6ffa the RecordVersion parameter has been
removed, but it remains in the javadoc.

Reviewers: Ismael Juma
2025-01-21 18:35:13 -08:00
Bill Bejeck adb0332114
MINOR: Ignore streams eos test until we have an agreed upon fix. (#18664)
Ignore the streams_eos_test.py until we come up with a fix for creating local standby tasks on startup.
Reviewers: Matthias Sax<mjsax@apache.org>
2025-01-21 18:28:52 -05:00
Matthias J. Sax f2f9e84bca
KAFKA-17402: DefaultStateUpdated should transite task atomically (#18607)
Reviewers: Bruno Cadonna <bruno@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2025-01-21 12:33:48 -08:00
David Arthur 967a19732a
MINOR Fix condition in flaky test report workflow (#18599)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2025-01-21 13:38:14 -05:00
Clay Johnson e9e03faf87
KAFKA-18454 Publish build scans to develocity.apache.org (#18539)
This patch includes some maintenance updates for Develocity.

* Publish build scans to develocity.apache.org
* Update Develocity Gradle plugin to to 3.19
* Use `DEVELOCITY_ACCESS_KEY` to authenticate to `develocity.apache.org`

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>
2025-01-21 13:37:27 -05:00
David Jacot b368c38684
KAFKA-18302; Update CoordinatorRecord (#18512)
This patch does a few things:
1) Replace ApiMessageAndVersion by ApiMessage in CoordinatorRecord for the key
2) Leverage the fact that ApiMessage exposes the apiKey. Hence we don't need to specify the key anymore.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-21 18:11:26 +01:00
Artem Livshits 247c0f0ba5
KAFKA-15370: Support Participation in 2PC (KIP-939) (2/N) (#18316)
Update producer id request / response formats and transaction log value format. There is no functional change.

Reviewers: Justine Olshan <jolshan@confluent.io>, Calvin Liu <caliu@confluent.io>
2025-01-21 08:40:46 -08:00
Matthias J. Sax ba774a09f4
KAFKA-8862: Improve Producer error message for failed metadata update (#18587)
We should provide the same informative error message for both timeout
cases.

Reviewers: Kirk True <ktrue@confluent.io>, Andrew Schofield <aschofield@confluent.io>, Ismael Juma <ismael@juma.me.uk>
2025-01-21 08:37:45 -08:00
Matthias J. Sax faff2de6a5
KAFKA-17561: add processId tag to thread-state metric (#18581)
Part of KIP-1091.

Reviewers: Bill Bejeck <bill@confluent.io>
2025-01-21 08:09:43 -08:00
Ken Huang 3d49159c84
KAFKA-18598: Remove ControllerMetadataMetrics ZK-related Metrics (#18629)
Reviewers: Christo Lolov <lolovc@amazon.com>
2025-01-21 15:23:39 +00:00
Andrew Schofield 7cbfd22bde
MINOR: Improve javadoc for ListShareGroupOffsetsResult (#18650)
Reviewers: Lianet Magrans <lmagrans@confluent.io>, PoAn Yang <payang@apache.org>, Apoorv Mittal <apoorvmittal10@gmail.com>
2025-01-21 13:56:40 +00:00
Ken Huang b4674c002f
KAFKA-18585 Fix fail test ValuesTest#shouldConvertDateValues (#18611)
Reviewers: Divij Vaidya <diviv@amazon.com>, Andrew Schofield <aschofield@confluent.io>
2025-01-21 13:51:39 +00:00
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
Lucas Brutschy 7d39ba1ef8
KAFKA-18311: Internal Topic Manager (5/5) (#18442)
The internal topic manager takes a requested topology and returns a configured topology, as well as any internal topics that need to be created.

Shares with the client-side "InternalTopicManager" the name only.

Reviewers: Bruno Cadonna <cadonna@apache.org>
2025-01-21 09:42:07 +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
Ken Huang d0bca67b27
KAFKA-18363: Remove ZooKeeper mentiosn in broker configs (#18346)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, TengYao Chi <kitingiao@gmail.com>
2025-01-20 18:22:40 +01: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