Commit Graph

5319 Commits

Author SHA1 Message Date
Yung fa54065298
KAFKA-18086: Enable propagation of the error message when writing state (#17980)
* KAFKA-18086: Enable propagation of the error message when writing state

* Propagate the error message in the writing state when calling SharePartitionManager.acknowledge and SharePartitionManager.releaseSession, and add corresponding tests to verify that the expected error message is propagated.

* Reviewers: Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>
2024-12-05 17:48:26 +00:00
David Jacot e99561e1f3
KAFKA-17593; [10/N] Remove resolved regular expressions when unsubscribed (#17976)
This patch does a few things:
1) It cleans up resolved regular expressions when they are unsubscribed from. It covers the regular leave/fenced paths for the new protocol and it also covers the LeaveGroup API as new members could be removed via the admin API.
2) It ensures that tombstones for  resolved regular expressions are generated on the conversion patch from consumer to classic group.
3) It fixes [KAFKA-18116](https://issues.apache.org/jira/browse/KAFKA-18116) because I faced the same issue while working on the LeaveGroup API. It adds an integration test for this case too.

Reviewers: Dongnuo Lyu <dlyu@confluent.io>, Jeff Kim <jeff.kim@confluent.io>
2024-12-04 23:41:37 -08:00
Ken Huang 2b43c49f51
KAFKA-18050 Upgrade the checkstyle version to 10.20.2 (#17999)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-05 10:59:18 +08:00
Apoorv Mittal 2d39d5be64
KAFKA-17783: Adding listeners to remove share partition on partition changes (#17796)
Reviewers: Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Jun Rao <junrao@gmail.com>
2024-12-04 15:43:37 -08:00
Lianet Magrans bd0ea70912
KAFKA-18096: Allow join with regex if no matching topics (#18024)
Reviewers: David Jacot <djacot@confluent.io>
2024-12-04 11:35:42 -05:00
Andrew Schofield 423a6353a8
KAFKA-18025: Rework acquisition lock timeout test (#17985)
Additional work on ShareConsumerTest.testAcquisitionLockTimeoutOnConsumer. First, mark the test as flaky since it fails occasionally and it would be best to get a decent number of passes before assuming it's no longer flaky. Then, change the assertions so that the test checks which records were received before it counts them (we might get too many records because the wrong records are being returned, or because records are actually being duplicated). The rare failures appear to be related to returning too many records, so it would be good to see whether we can learn more about the duplication.

There are a couple of other improvements too. Reducing the number of share-group state partitions so we don't have the overhead of creating 50 partitions when a few will do. Changing the warm-up logic since that has been observed very occasionally to assert.

Reviewers: ShivsundarR <shr@confluent.io>,  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-12-04 20:58:55 +05:30
Lianet Magrans f60382bf21
KAFKA-18127 Validate SubscriptionPattern used on v0 HB (#17989)
Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-04 19:55:12 +08:00
Peter Lee 095bd0a6d4
KAFKA-18101: Merge duplicate assertFutureThrows and assertFutureExceptionTypeEquals (#17991)
Reviewers: Ziming Deng<dengziming1993@gmail.com>,  Chia-Ping Tsai<chia7712@gmail.com>,  TaiJuWu<tjwu1217@gmail.com>.
2024-12-04 14:15:03 +08:00
Justine Olshan dbae448a05
KAFKA-18137: Unloading transaction state incorrectly removes loading partitions (#18011)
When there is a become follower transition on a transaction coordinator state partition, we intend to unload the state partition. However, we pass the new epoch to the method that does the unloading. In that method, we create a `TransactionPartitionAndLeaderEpoch` object comprising of the topic partition and the epoch that we use as a key to remove the partition from loading. However, we wouldn't ever expect to see this epoch in that map since we only load on the leader. See the code snippet: d00f0ecf1a/core/src/main/scala/kafka/coordinator/transaction/TransactionStateManager.scala (L602)

We could have a partition load after the unloading occurs, and that partition will be stuck storing stale state on the broker until it restarts. While this may not immediately cause a correctness issue, we should try to properly clean up state.

Check that the epoch is less than the new epoch when removing the partition from loadingPartitions.

Added a test that failed before this change was made.

Reviewers: Artem Livshits <alivshits@confluent.io>, Jeff Kim <jeff.kim@confluent.io>
2024-12-03 14:51:07 -08:00
PoAn Yang fe88232b07
KAFKA-17750 Extend kafka-consumer-groups command line tool to support new consumer group (part 1) (#17958)
1) Bump validVersions of ConsumerGroupDescribeRequest.json and ConsumerGroupDescribeResponse.json to "0-1".

2) Add MemberType field to ConsumerGroupDescribeResponse.json. Default value is -1 (unknown). 0 is for classic member and 1 is for consumer member.

3) When ConsumerGroupMember#useClassicProtocol is true, return MemberType field as 0. Otherwise, return 1.

Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-04 06:08:39 +08:00
Kuan-Po Tseng ac8b3dfbf0
KAFKA-18060 new coordinator does not handle TxnOffsetCommitRequest with empty member id when using CONSUMER group (#17914)
There are two issues in KAFKA-18060:

1) New coordinator can't handle the TxnOffsetCommitRequest with empty member id, and TxnOffsetCommitRequest v0-v2 do definitely has an empty member ID, causing ConsumerGroup#validateOffsetCommit to throw an UnknownMemberIdException. This prevents the old producer from calling sendOffsetsToTransaction. Note that TxnOffsetCommitRequest versions v0-v2 are included in KIP-896, so it seems the new coordinator should support that operations

2) The deprecated API Producer#sendOffsetsToTransaction does not use v0-v2 to send TxnOffsetCommitRequest with an empty member ID. Unfortunately, it has been released for a while. Therefore, the new coordinator needs to handle TxnOffsetCommitRequest with an empty member ID for all versions.

Taken from the two issues above, we need to handle empty member id in all API versions when new coordinator are dealing with TxnOffsetCommitRequest.

Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-04 02:55:19 +08:00
Abhinav Dixit 180112a4a9
KAFKA-18084 Added write locks in SharePartition where locks were async calls were being made (#17957)
Reviewers: Andrew Schofield <aschofield@confluent.io>, poorv Mittal <apoorvmittal10@gmail.com>, Sushant Mahajan <sushant.mahajan88@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-04 01:46:29 +08:00
David Jacot 275b995bf2
KAFKA-18095; Allow a member to join without subscription under new consumer protocol (#18003)
This patch relaxes requiring non-empty subscribed names and regex in the full heartbeat request. Without this, a consumer using client side regexes may not be able to join the group when the regex does not match any topics yet and this is inconsistent with the old protocol. Relaxing the subscribed regex is not strictly required but it seems better to keep it consistent.

Reviewers: Lianet Magrans <lmagrans@confluent.io>
2024-12-03 02:11:36 -08:00
Manikumar Reddy f87c04854b
KAFKA-18013: Add integration test for duration based reset strategy in KafkaConsumer (#18008)
Add new test case to PlaintextConsumerFetchTest

Reviewers: Lianet Magrans <lmagrans@confluent.io>
2024-12-03 10:33:57 +05:30
Chia-Chuan Yu d00f0ecf1a
KAFKA-18124 Remove zk migration from `RaftManagerTest`, `BrokerLifecycleManagerTest`, `KafkaConfigTest`, and `ReplicaManagerTest` (#17990)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-03 03:27:12 +08:00
TengYao Chi 6fd951a9c0
KAFKA-17610 Drop alterConfigs (#18002)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-02 23:26:06 +08:00
Yung 45c094ed23
KAFKA-18130 Remove kafka.utils.VersionInfo (#18001)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-02 15:36:53 +08:00
PoAn Yang 60ce83b2c6
KAFKA-18123 Fix flaky DynamicBrokerReconfigurationTest#testThreadPoolResize (#17986)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-01 20:58:02 +08:00
dengziming 615f1a0bf9
KAFKA-16181: Use incrementalAlterConfigs when updating broker configs by kafka-configs.sh (#15304)
This PR implement KIP-1011, kafka-configs.sh now uses incrementalAlterConfigs API to alter broker configurations instead of the deprecated alterConfigs API, and it will fall directly if the broker doesn't support incrementalAlterConfigs.

Reviewers: David Jacot <djacot@confluent.io>, OmniaGM <o.g.h.ibrahim@gmail.com>.
2024-12-01 18:32:02 +08:00
Lianet Magrans 6237325fb1
KAFKA-15561 [5/N]: Integration tests for new subscribe API with Re2J pattern (#17964)
- integration tests for new subscribe api with RE2J pattern
- fix to ensure all topics are included in metadata requests when consumer is subscribed to RE2J pattern

Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-11-30 01:02:39 +08:00
Ken Huang 9d23f89e05
KAFKA-17338 ConsumerConfig should prevent using partition assignors with CONSUMER group protocol (#16899)
Reviewers: Kirk True <ktrue@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Lianet Magrans <lmagrans@confluent.io>
2024-11-29 09:36:29 -05:00
Colin Patrick McCabe b8c8e0c713
MINOR: Convert DynamicBrokerReconfigurationTest to KRaft (#17905)
Convert testUncleanLeaderElectionEnable and testMetricsReporterUpdate to KRaft.

Remove testAdvertisedListenerUpdate, testAddRemoveSslListener, testAddRemoveSaslListeners since we no longer support dynamically adding or removing network listeners when in KRaft mode.

Make TestUtils.ensureConsistentKRaftMetadata robust against brokers that don't have sharedServer.loader initialized yet (or have shut down).

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-28 11:59:38 -08:00
HYUNSANG HAN (한현상, Travis) 700bdd5fee
KAFKA-17997 Remove deprecated config log.message.timestamp.difference.max.ms (#17928)
Reviewers: Divij Vaidya <diviv@amazon.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-11-29 03:15:46 +08:00
Peter Lee b08b64c2d8
KAFKA-18098 add kraft support to testReplicaPlacementAllServers and testReplicaPlacementPartialServers (#17955)
Reviewers: Yung <yungyung7654321@gmail.com>, Colin P. McCabe <cmccabe@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2024-11-28 05:21:47 +08:00
Colin Patrick McCabe cdf3aab661
MINOR: remove zk from several tests (#17949)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-28 04:52:04 +08:00
TaiJuWu 486f65e8c6
KAFKA-18100 `Using` block suppresses all errors (#17954)
https://github.com/apache/kafka/pull/15881 changed our tests to utilize `using` blocks. But these blocks don't throw any errors, so if there is a failed assertion within the block, the test will still pass. 

We should either check the failure using a corresponding `match` block with Success(_) and Failure(e), use `using.resource`, or use try/finally blocks to clean up resources.

See https://www.scala-lang.org/api/3.0.2/scala/util/Using$.html

Co-authored-by: frankvicky <kitingiao@gmail.com>

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-28 03:25:19 +08:00
David Jacot aae42ef656
KAFKA-17593; [9/N] Mark ConsumerGroupHeartbeat API v1 as stable (#17961)
Reviewers: Lianet Magrans <lmagrans@confluent.io>
2024-11-27 13:03:46 -05:00
Yung 434fe7c26e
KAFKA-18081 Remove isKRaftTest from the kraft-only tests (#17934)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-27 18:37:43 +08:00
Calvin Liu 2b2b3cd355
KAFKA-18062: use feature version to enable ELR (#17867)
Replace the ELR static config with feature version.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2024-11-26 14:40:23 -08:00
PoAn Yang 98d47f47ef
KAFKA-18028 the effective kraft version of --no-initial-controllers should be 1 rather than 0 (#17836)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-27 01:45:11 +08:00
Ken Huang b42efc7dc2
KAFKA-18049: Upgrade the caffeine version to 3.1.1 (#17879)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2024-11-26 18:00:50 +01:00
David Jacot 24dd11d693
KAFKA-17593; [8/N] Resolve regular expressions (#17864)
This patch introduces the asynchronous resolution of regular expressions. Let me unpack a few details about the implementations:
1) I have decided to finally update all the regular expressions within a consumer group together. My assumption is that the number of regular expressions in a group will be generally small but the number of topics in a cluster is large. Hence grouping has two benefits. Firstly, it allows to go through the list of topics once for all the regular expressions. Secondly, it reduces the number of potential rebalances because all the regular expressions are updated at the same time.
2) An update is triggered when the group is subscribed to at least one regular expressions.
3) An update is triggered when there is no ongoing update.
4) An update is triggered only of the previous one is older than 10s.
5) An update is triggered when the group has unresolved regular expressions.
6) An update is triggered when the metadata image has new topics.

Reviewers: Jeff Kim <jeff.kim@confluent.io>
2024-11-26 08:56:25 -08:00
Andrew Schofield 11ce41fb1d
KAFKA-18092: Mark testBumpTransactionalEpochWithTV2Enabled as flaky (#17945)
Reviewers: Lianet Magrans <lmagrans@confluent.io>
2024-11-26 11:04:53 -05:00
TengYao Chi 0e4d8b3e86
KAFKA-17569 Rewrite TestLinearWriteSpeed by Java (#17736)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-26 23:43:01 +08:00
Yung cebec91470
KAFKA-18080 Replace DelayedItem by Long type (#17927)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-26 17:00:27 +08:00
Andrew Schofield 48d60efe98
KAFKA-17990: Deflake testShareAutoOffsetResetDefaultValue (#17916)
ShareConsumerTest.testShareAutoOffsetResetDefaultValue has been tightened up by making sure that records produced have been flushed before starting consumption. A possible but unlikely race condition seems the source of the flakiness and this should now be eliminated in the previous PR to this test case.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2024-11-26 10:18:29 +05:30
Andrew Schofield d17a149205
KAFKA-17956 Remove Admin.listShareGroups (#17912)
KIP-1043 introduced Admin.listGroups as the way to list all types of groups. As a result, Admin.listShareGroups has been removed. This PR is the final step of the removal.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-25 22:05:35 +08:00
Kuan-Po Tseng ccbb73111c
KAFKA-18078 Fix failed MetricsTest.testJMXFilter (#17924)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-24 15:24:04 +08:00
Yung 8a90ca0528
KAFKA-18076 Remove `isZkMigrationTest` and related code (#17922)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-24 00:23:27 +08:00
Colin Patrick McCabe ec3bc092e1
MINOR: remove some obsolete zk tests (#17913)
Reviewers: David Arthur <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-11-23 22:28:58 +08:00
Lianet Magrans e60e61cb63
MINOR: enable consumer auth tests (#17885)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-22 16:36:08 -05:00
Mickael Maison 33318bc0f4
KAFKA-18000: Fix flaky ReplicaManagerTest#testSuccessfulBuildRemoteLogAuxStateMetrics (#17887)
Reviewers: David Arthur <mumrah@gmail.com>
2024-11-22 20:40:51 +01:00
Colin Patrick McCabe c2352f804c
MINOR: remove SaslPlainPlaintextConsumerTest.testZkAclsDisabled (#17902)
Reviewers: David Arthur <mumrah@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-11-22 23:55:14 +08:00
Nick Guo 7db4d53f18
KAFKA-12690 Remove deprecated Producer#sendOffsetsToTransaction (#17865)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-22 18:07:10 +08:00
Andrew Schofield 32c887b05e
KAFKA-17949: Introduce GroupState and replace ShareGroupState (#17763)
This PR introduces the unified GroupState enum for all group types from KIP-1043. This PR also removes ShareGroupState and begins the work to replace Admin.listShareGroups with Admin.listGroups. That will complete in a future PR.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2024-11-19 21:17:12 +05:30
David Arthur 8f63a77ba1
MINOR quarantine flaky tests for Nov 18, 2024 (#17845) 2024-11-18 16:56:12 -05:00
Dmitry Werner cd1bf196f0
MINOR: Delete unused logging argument from SocketServer#closeSocket (#17835)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-18 18:29:20 +08:00
TengYao Chi 53d8316b5d
KAFKA-14934 KafkaClusterTestKit makes FaultHandler accessible (#17774)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-18 18:23:54 +08:00
Kuan-Po Tseng 00cd9cd3f9
KAFKA-18003: Add test to make sure `Admin#deleteRecords` can handle the corrupted records (#17840)
Reviewers: Divij Vaidya <diviv@amazon.com>
2024-11-18 10:36:01 +01:00
PoAn Yang 078d34f39d
KAFKA-17910 Create integration tests for Admin.listGroups and Admin.describeClassicGroups (#17712)
Reviewers: Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-11-18 16:35:48 +08:00