Commit Graph

13211 Commits

Author SHA1 Message Date
Colin P. McCabe 234ea4bceb address review feedback 2024-07-01 15:38:58 -07:00
Colin P. McCabe ab1b566759 Address review comments 2024-06-27 15:24:58 -07:00
Colin P. McCabe 3e07a3b7e0 Add BrokerRegistrationRequest v4 2024-06-27 15:21:11 -07:00
Colin P. McCabe c0e3c7ca13 Merge branch 'trunk' into KAFKA-17011 2024-06-27 14:11:43 -07:00
Colin Patrick McCabe ebaa108967
KAFKA-16968: Introduce 3.8-IV0, 3.9-IV0, 3.9-IV1
Create 3 new metadata versions:

- 3.8-IV0, for the upcoming 3.8 release.
- 3.9-IV0, to add support for KIP-1005.
- 3.9-IV1, as the new release vehicle for KIP-966.

Create ListOffsetRequest v9, which will be used in 3.9-IV0 to support KIP-1005. v9 is currently an unstable API version.

Reviewers: Jun Rao <junrao@gmail.com>, Justine Olshan <jolshan@confluent.io>
2024-06-27 14:03:03 -07:00
Matthias J. Sax dc7c9ad068
MINOR: pass in timeout to Admin.close() (#16422)
Reviewers: Luke Chen <showuon@gmail.com>, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Apoorv Mittal <amittal@confluent.io>, Bruno Cadonna <bruno@confluent.io>
2024-06-27 12:14:05 -07:00
Shawn Hsu 3ebad6349d
MINOR: Fix missing code tag in doc (#16466)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-27 20:52:46 +08:00
gongxuanzhang 1040d78372
KAFKA-10787 Apply spotless to all module (#16467)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-27 20:50:06 +08:00
Apoorv Mittal 60114a46a7
KAFKA-16822: Abstract consumer group to share functionality with share group (KIP-932) (#16054)
Abstracted code for 2 classes `ConsumerGroup` and `ConsumerGroupMember` to `ModernGroup` and `ModernGroupMember` respectively. The new abstract classes are created to share common functionality with `ShareGroup` and `ShareGroupMember` which are being introduced with KIP-932.

The patch is majorly code refactoring from existing classes to abstract classes. Also created a new package called `modern` where `MemberState` class is moved, in upcoming patches, I will move common classes for `Share` and `Consumer` Group in `modern` package itself. 

Reviewers: Lianet Magrans <lianetmr@gmail.com>, Andrew Schofield <aschofield@confluent.io>, David Jacot <djacot@confluent.io>
2024-06-27 05:42:58 -07:00
Omnia Ibrahim c2de7c5e54
MINOR: Clarify Spotless instructions in README.md (#16471)
Reviewers: Igor Soarez <soarez@apple.com>
2024-06-27 12:04:08 +01:00
Abhinav Dixit 49e9bd4a5b
KAFKA-16754: Implemented release acquired records functionality to SharePartition (#16430)
About
Implemented release acquired records functionality in SharePartition. This functionality is used when a share session gets closed, hence all the acquired records should either move to AVAILABLE or ARCHIVED state. Implemented the following functions -

1. releaseAcquiredRecords - This function is executed when the acquisition lock timeout is reached. The function releases the acquired records.
2. releaseAcquiredRecordsForCompleteBatch - Function which releases acquired records maintained at a batch level.
3. releaseAcquiredRecordsForPerOffsetBatch - Function which releases acquired records maintained at an offset level.

Testing
Added unit tests to cover the new functionality added.


Reviewers:  Andrew Schofield <aschofield@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2024-06-27 15:33:46 +05:30
Ken Huang 9b4f13efbc
KAFKA-15623 Remove junit 4 from stream module (#16447)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-27 15:11:32 +08:00
Abhinav Dixit 399949ebcf
KAFKA-16751: Implemented release acquired records functionality in SharePartitionManager (#16446)
About
Implemented releaseAcquiredRecords functionality in SharePartitionManager which will act as a bridge between the call from KafkaApis to SharePartition for releasing the acquired records when a share session gets closed.

Testing
The added function has been tested with unit tests.

Reviewers:  Andrew Schofield <aschofield@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2024-06-27 02:18:54 +05:30
Ian McDonald 2074e5a6db
MINOR: Update Trogdor readme commands (#16453)
Remove > characters from the trogdor readme so that people who follow the guide don't accidentally write over their bin files.

Reviewers: Justine Olshan <jolshan@confluent.io>
2024-06-26 09:16:59 -07:00
Lucas Brutschy 7ab7773617
MINOR: Update 3.8 documentation for Kafka Streams (#16265)
All public interface changes should be briefly mentioned in the
upgrade guide.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Anna Sophie Blee-Goldman <sophie@responsive.dev>, Nick Telford <nick.telford@gmail.com>
2024-06-26 13:55:18 +02:00
Abhinav Dixit 93dd9acad0
KAFKA-17003: Implemented SharePartitionManager close() functionality (#16431)
About
Implemented close() functionality of SharePartitionManager to avoid any chances of memory leak. The functionality will be utilized when the sharePartitionObject is closed, at the time when BrokerServer is killed.

Testing
Added unit tests to cover the new functionality added.

Reviewers:  Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
2024-06-26 17:12:01 +05:30
José Armando García Sancio adee6f0cc1
KAFKA-16527; Implement request handling for updated KRaft RPCs (#16235)
Implement request handling for the updated versions of the KRaft RPCs (Fetch, FetchSnapshot, Vote,
BeginQuorumEpoch and EndQuorumEpoch). This doesn't add support for KRaft replicas to send the new
version of the KRaft RPCs. That will be implemented in KAFKA-16529.

All of the RPCs responses were extended to include the leader's endpoint for the listener of the
channel used in the request. EpochState was extended to include the leader's endpoint information
but only the FollowerState and LeaderState know the leader id and its endpoint(s).

For the Fetch request, the replica directory id was added. The leader now tracks the follower's log
end offset using both the replica id and replica directory id.

For the FetchSnapshot request, the replica directory id was added. This is not used by the KRaft
leader and it is there for consistency with Fetch and for help debugging.

For the Vote request, the replica key for both the voter (destination) and the candidate (source)
were added. The voter key is checked for consistency. The candidate key is persisted when the vote
is granted.

For the BeginQuorumEpoch request, all of the leader's endpoints are included. This is needed so
that the voters can return the leader's endpoint for all of the supported listeners.

For the EndQuorumEpoch request, all of the leader's endpoints are included. This is needed so that
the voters can return the leader's endpoint for all of the supported listeners. The successor list
has been extended to include the directory id. Receiving voters can use the entire replica key when
searching their position in the successor list.

Updated the existing test in KafkaRaftClientTest and KafkaRaftClientSnapshotTest to execute using
both the old version and new version of the RPCs.

Reviewers: Luke Chen <showuon@gmail.com>, Colin P. McCabe <cmccabe@apache.org>
2024-06-25 13:45:15 -07:00
Chia Chuan Yu 5b0e96d785
KAFKA-17034 Tweak some descriptions in FeatureUpdate (#16448)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-26 03:05:34 +08:00
Colin P. McCabe 1dc5f990b3 Update NetworkClientTest 2024-06-25 10:56:39 -07:00
Justine Olshan a599b89fe0
Revert "KAFKA-16275: Update kraft_upgrade_test.py to support KIP-848’s group protocol config (#16409) (#16441)
This reverts commit e95e91a.

With the change to include the group.version flag, these tests fail due to trying to set the feature for the old version.

It is unclear if these tests originally worked as intended and given the upgrade is not expected for 3.8, we will just revert from 3.8.

Reviewers: David Jacot <djacot@confluent.io>
2024-06-25 10:15:58 -07:00
vamossagar12 ceec218351
KAFKA-16949: Fixing test_dynamic_logging in system test connect_distributed_test (#15915)
Reviewers: Chris Egerton <chrise@aiven.io>
2024-06-25 12:36:04 -04:00
PoAn Yang f995edccad
KAFKA-16551 add integration test with bootstrap controller for ClusterTool (#16439)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-26 00:01:08 +08:00
Andrew Schofield 63304fb6e5
KAFKA-17028: FindCoordinator v6 initial implementation (#16440)
KIP-932 introduces FindCoordinator v6 for finding share coordinators. The initial implementation:

Checks that share coordinators are only requested with v6 or above.
Share coordinator requests are authorized as cluster actions (this is for inter-broker use only)
Responds with COORDINATOR_NOT_AVAILABLE because share coordinators are not yet available.
When the share coordinator code is delivered, the request handling will be gated by configurations which enable share groups and the share coordinator specifically. If these are not enabled, COORDINATOR_NOT_AVAILABLE is the response.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2024-06-25 21:13:16 +05:30
Kuan-Po (Cooper) Tseng 0353337f5f
KAFKA-16650 add integration test for Admin#abortTransaction (#16429)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-25 23:11:19 +08:00
dujian0068 b07688b063
MINOR: Improve TaskAssignor#onAssignmentComputed() javadoc (#16434) 2024-06-25 22:28:36 +08:00
Murali Basani 87f8147ed0
KAFKA-16855 : Part 1 - New fields tieredEpoch and tieredState (#16257)
Add field tieredEpoch to RemoteLogSegmentMetadata
Update relevant tests
Add two fields tieredEpoch and tieredState to TopicRecord.json

Reviewers: Luke Chen <showuon@gmail.com>, Christo Lolov <lolovc@amazon.com>
2024-06-25 15:00:12 +01:00
PoAn Yang db1c8a80c4
KAFKA-15623 (5/N) Migrate KafkaStreamsTest to JUnit 5 (#16424)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-25 18:18:49 +08:00
Abhinav Dixit 3f3b070a6a
KAFKA-16755: Implement lock timeout functionality in SharePartition (#16414)
Implemented acquisition lock timeout functionality in SharePartition. Implemented the following functions -

1. releaseAcquisitionLockOnTimeout - This function is executed when the acquisition lock timeout is reached. The function releases the acquired records.
2. releaseAcquisitionLockOnTimeoutForCompleteBatch - Function which releases acquired records due to acquisition lock timeout maintained at a batch level.
3. releaseAcquisitionLockOnTimeoutForPerOffsetBatch - Function which releases acquired records due to acquisition lock timeout maintained at an offset level.

Reviewers:  Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>,
2024-06-25 12:37:28 +05:30
Colin P. McCabe 6235178031 pass through the ApiVersionsResponse version to ChannelBuilders 2024-06-24 17:04:36 -07:00
Alieh Saeedi f4cbf71ea6
KAFKA-16965: Throw cause of TimeoutException (#16344)
Add the cause of TimeoutException for Producer send() errors.

Reviewers: Matthias J. Sax <matthias@confluent.io>,  Lianet Magrans <lianetmr@gmail.com>, Artem Livshits <alivshits@confluent.io>, Justine Olshan <jolshan@confluent.io>
2024-06-24 14:51:27 -07:00
dujian0068 78372b6883
KAFKA-17013 RequestManager#ConnectionState#toString() should use %s (#16413)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-24 23:44:39 +08:00
Abhinav Dixit 42058462ac
MINOR: Remove extra synchronized block in SharePartitionManager (#16436)
Removed an extra synchronized block encapsulating cache.remove(key). remove(ShareSessionKey key) function is already a synchronized method, hence we don't need it.


Reviewers:  Andrew Schofield <aschofield@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2024-06-24 19:47:05 +05:30
TingIāu "Ting" Kì d78ff06476
KAFKA-16967 NioEchoServer fails to register connection and causes flaky failure. (#16384)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-24 21:39:40 +08:00
PoAn Yang 3a0c83e490
KAFKA-16551 add integration test for ClusterTool (#16408)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-24 14:04:45 +08:00
TingIāu "Ting" Kì 0e346d3103
KAFKA-15623 (4/N) Migrate streams tests (processor) module to JUnit 5 (#16396)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-24 13:06:35 +08:00
Kuan-Po (Cooper) Tseng fd00a3e58a
KAFKA-16998 Fix warnings in our Github actions (#16410)
Reviewers: Vedarth Sharma <vesharma@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-24 12:53:49 +08:00
Ken Huang 8a109d87d1
KAFKA-17009 Add unit test to query nonexistent replica by describeReplicaLogDirs (#16423)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-23 16:25:57 +08:00
Pavel Pozdeev 7fe3374f7a
KAFKA-15713 KRaft support in AclCommandTest (#15830)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-22 21:29:23 +08:00
Dmitry Werner 96171026d5
MINOR: Remove unused method 'createDirectoriesFrom' in DirectoryId (#16419)
Reviewers: Igor Soarez <soarez@apple.com>, Gaurav Narula <gaurav_narula2@apple.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-22 20:09:33 +08:00
Colin P. McCabe 1c1e556528 KAFKA-17011: Fix a bug preventing features from supporting v0
As part of KIP-584, brokers expose a range of supported versions for each feature. For example,
metadata.version might be supported from 1 to 21. (Note that feature level ranges are always
inclusive, so this would include both level 1 and 21.)

These supported ranges are supposed to be able to include 0. For example, it should be possible for
a broker to support a kraft.version between 0 and 1. However, in older software versions, there is
an assertion in org.apache.kafka.common.feature.SupportedVersionRange that prevents this. This
causes problems when the older software attempts to deserialize an ApiVersionsResponse containing
such a range.

In order to resolve this dilemma, this PR bumps the version of ApiVersionsRequest from 3 to 4.
Clients which send v4 promise to be able to handle ranges including 0. Clients which send v3 will
not be exposed to these ranges -- the feature will simply be omitted from the response. This work
is part of KIP-1022.
2024-06-21 16:23:54 -07:00
Apoorv Mittal 7d702e1760
KAFKA-16749: Implemented share fetch messages (KIP-932) (#16377)
Share group consumers use the ShareFetch API to retrieve messages they've claimed (acquired records) from the leader brokers of share partitions.

The replica manager provides an API to retrieve messages directly from the underlying topic partition. The implementation of the fetch messages uses replica manager to fetch messages from specific offset known by share partition leader.

The requests are sent to a queue and processed asynchronously.

Reviewers:  Andrew Schofield <aschofield@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>
2024-06-21 20:24:21 +05:30
gongxuanzhang e294ea433c
KAFKA-17012 Enable CONSUMER protocol for some tests of KafkaConsumerTest (#16415)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-21 21:58:24 +08:00
PoAn Yang 645eefe95a
KAFKA-17007 Fix SourceAndTarget#equal (#16416)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-21 20:52:07 +08:00
Apoorv Mittal 9b5b434e2a
KAFKA-16999: Integrating persister API in Partition initilization (KIP-932) (#16397)
Integrated Persister Read API while initilazing Share Partition.
The share partition checks for any pre-existing data from persister and initializes the state accordingly.

Reviewers:  Andrew Schofield <aschofield@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>, Abhinav Dixit <adixit@confluent.io>
2024-06-21 14:14:11 +05:30
Murali Basani 4194e3d163
MINOR: Rename log4j variables to reload4j (#16324)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Greg Harris <gharris1727@gmail.com>
2024-06-21 10:43:07 +02:00
Mickael Maison 0772144e51
MINOR: Add javadoc for Connect public packages/classes (#16404)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-21 10:23:35 +02:00
gongxuanzhang 8d92535382
KAFKA-10787 apply spotless to connect:runtime module (#16412)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-21 16:04:51 +08:00
Luke Chen d646a09dd0
KAFKA-16531: calculate check-quorum when leader is not in voter set (#16211)
In the check-quorum calculation, the leader should not assume that it is part of the voter set. This may happen when the leader is removing itself from the voter set. This PR improves it by checking if leader is in the voter set or not, and decide how many follower fetches required. Also add tests.

Co-authored-by: Colin P. McCabe <cmccabe@apache.org>

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, José Armando García Sancio <jsancio@apache.org>
2024-06-21 11:22:24 +08:00
NICOLAS GUYOMAR 8db7b31c8b
MINOR: Lower InvalidProducerEpochException log level (#16407)
There is no Kafka Administrator action needed for an InvalidProducerEpochException, ERROR level is worrisome while such exception can happen for a variety of valid reason, by design

Proposing to lower the log level from ERROR to INFO

Reviewers: Justine Olshan <jolshan@confluent.io>
2024-06-20 16:24:53 -07:00
Wang Xiaoqing 64702bcf6f
KAFKA-16862: Refactor ConsumerTaskTest to be deterministic and avoid tight loops (#16303)
Reviewers: Greg Harris <greg.harris@aiven.io>
2024-06-20 12:35:14 -07:00