Commit Graph

15115 Commits

Author SHA1 Message Date
Sushant Mahajan b92cd9d236
KAFKA-18632: Added few share consumer multibroker tests. (#18679)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-27 12:56:56 +00:00
Chung, Ming-Yen a8f6fc9cc4
KAFKA-18631 Remove ZkConfigs (#18693)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-26 04:37:49 +08:00
TengYao Chi 9bab9dc023
MINOR: Remove EMPTY_NODE_ID (#18707)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-26 04:28:01 +08:00
Chirag Wadhwa c09d2c940f
KAFKA-18642: Increased the timeouts in share_consumer_test.py system tests (#18699)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-01-25 19:23:40 +00:00
PoAn Yang be7415cb8b
KAFKA-18555 Avoid casting MetadataCache to KRaftMetadataCache (#18632)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-25 23:02:28 +08:00
PoAn Yang c774352c35
MINOR: add removed controller metrics to zk2kraft (#18654)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-25 22:54:27 +08:00
Ken Huang c40e7a1341
KAFKA-18533 Remove KafkaConfig zookeeper related logic (#18547)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-25 22:52:21 +08:00
Chung, Ming-Yen 43af241b50
KAFKA-18639 Enable the @Flaky annotation for some flaky tests (#18701)
The following tests were previously reported as flaky but were only annotated with a comment in pull request #18558 due to module dependency limitations:

    testAdminClientApisAuthenticationFailure
    testOutdatedCoordinatorAssignment
    testThrottledProducerConsumer

With the introduction of the new test infrastructure #18602 , which allows all modules to use the @Flaky annotation, these tests should now be updated to include the @Flaky annotation.

Reviewers: TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-25 22:44:35 +08:00
mingdaoy c23d4a0d73
KAFKA-18499 Clean up zookeeper from LogConfig (#18583)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-01-25 22:31:46 +08:00
TaiJuWu 023f9c26e6
KAFKA-18529: ConsumerRebootstrapTest should run for async consumer (#18554)
Reviewers: Kirk True <ktrue@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Lianet Magrans <lmagrans@confluent.io>
2025-01-24 20:33:20 +01:00
Calvin Liu 6235a73622
KAFKA-16540: Clear ELRs when min.insync.replicas is changed. (#18148)
In order to maintain the integrity of replication, we need to clear the ELRs of affected partitions when min.insync.replicas is changed. This could happen at the topic level, or at a global level if the cluster level default is changed.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2025-01-24 10:57:33 -08:00
Matthias J. Sax f13a22af0b
KAFKA-13722: remove usage of old ProcessorContext (#18292)
We want to deprecate an remove the old ProcessorContext. Thus, we need
to refactor Kafka Streams runtime code, to not make calls into the old
ProcessorContext but only into new code path.

Reviewers: Bill Bejeck <bill@confluent.io>
2025-01-24 10:31:31 -08:00
Apoorv Mittal 70eab7778d
KAFKA-17894: Implemented broker topic metrics for Share Group 1/N (KIP-1103) (#18444)
The PR implements the BrokerTopicMetrics defined in KIP-1103.

The PR also corrected the share-acknowledgement-rate and share-acknowledgement-count metrics defined in KIP-932 as they are moved to BrokerTopicMetrics, necessary changes to KIP-932 broker metrics will be done once we complete KIP-1103.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Jun Rao <junrao@gmail.com>
2025-01-24 09:34:54 -08:00
TengYao Chi 2f1bf2f2ab
KAFKA-18630: Clean ReplicaManagerBuilder (#18687)
Reviewers: Christo Lolov <lolovc@amazon.com>
2025-01-24 17:23:48 +00:00
David Arthur 8c0a0e07ce
KAFKA-17587 Refactor test infrastructure (#18602)
This patch reorganizes our test infrastructure into three Gradle modules:

":test-common:test-common-internal-api" is now a minimal dependency which exposes interfaces and annotations only. It has one project dependency on server-common to expose commonly used data classes (MetadataVersion, Feature, etc). Since this pulls in server-common, this module is Java 17+. It cannot be used by ":clients" or other Java 11 modules.

":test-common:test-common-util" includes the auto-quarantined JUnit extension. The @Flaky annotation has been moved here. Since this module has no project dependencies, we can add it to the Java 11 list so that ":clients" and others can utilize the @Flaky annotation

":test-common:test-common-runtime" now includes all of the test infrastructure code (TestKitNodes, etc). This module carries heavy dependencies (core, etc) and so it should not normally be included as a compile-time dependency.

In addition to this reorganization, this patch leverages JUnit SPI service discovery so that modules can utilize the integration test framework without depending on ":core". This will allow us to start moving integration tests out of core and into the appropriate sub-module. This is done by adding ":test-common:test-common-runtime" as a testRuntimeOnly dependency rather than as a testImplementation dependency. A trivial example was added to QuorumControllerTest to illustrate this.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-24 09:03:43 -05:00
Ken Huang 0c9df75295
KAFKA-18474: Remove zkBroker listener (#18477)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>, PoAn Yang <payang@apache.org>
2025-01-24 05:53:32 -08:00
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