Commit Graph

13147 Commits

Author SHA1 Message Date
gongxuanzhang 96989e4b64
KAFKA-10787 Apply spotless to core module (#16392)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-19 14:24:42 +08:00
Chia Chuan Yu 4ff83dc733
KAFKA-16957 Enable KafkaConsumerTest#configurableObjectsShouldSeeGeneratedClientId to work with CLASSIC and CONSUMER (#16370)
Reviewers: Kirk True <kirk@kirktrue.pro>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-19 09:35:10 +08:00
TingIāu "Ting" Kì b2758f4ac6
KAFKA-16989 Use StringBuilder instead of String concatenation (#16385)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-19 09:19:32 +08:00
Jinyong Choi e2060204fe
KAFKA-15302: Stale value returned when using store.all() with key deletion [docs] (#15495)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-06-18 17:45:19 -07:00
Apoorv Mittal f2a552a1eb
KAFKA-16753: Implement share acknowledge API in partition (KIP-932) (#16339)
The share-partition leader keeps track of the state and delivery attempts for in-flight records. However, delivery attempts tracking follows atleast-once semantics.

The consumer processes the records and acknowledges them upon successful consumption. This successful attempt triggers a transition to the "Acknowledged" state.

The code implements the functionality to acknowledge the offset/batches in the request to in-memory cached data.

Reviewers:  Andrew Schofield <aschofield@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>
2024-06-18 22:37:59 +05:30
Mickael Maison c4a3d2475f
MINOR: Refresh of the docs (#16375)
Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-18 17:15:47 +02:00
Lianet Magrans 8199290500
MINOR: consumer log fixes (#16345)
Reviewers: Kirk True <kirk@kirktrue.pro>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-18 22:51:33 +08:00
Colin Patrick McCabe 2fd00ce536
KAFKA-16952: Do not bump broker epoch when re-registering the same incarnation (#16333)
* KAFKA-16952: Do not bump broker epoch when re-registering the same incarnation

As part of KIP-858 (Handle JBOD broker disk failure in KRaft), we added some code that caused the
broker to re-register itself when transitioning from a MetadataVersion that did not support broker
directory IDs, to one that did. This code was necessary because otherwise the controller would not
be aware of what directories the broker held.

However, prior to this PR, the re-registration process acted exactly like a full registration. That
is, it bumped the broker epoch (which is meant to only be bumped on broker restart). This PR fixes
the code to keep the broker epoch the same if the incarnation ID is the same.

There are some other minor improvements here:

- The previous logic relied on a complicated combination of request version and previous broker
  epoch to understand if the request came from the same broker or not. This is not needed: either
  the incarnation ID is the same and it's the same process, or it is not and it isn't.

- We now log whether we're amending a registration, registering a previously unknown broker, or
  replacing a previous registration.

- Move changes to the HeartbeatManager to the end of the function, so that we will not do them if
  any validation step fails. Log4j messages are also generated at the end, for the same reason.

Reviewers: Ron Dagostino <rndgstn@gmail.com>
2024-06-18 07:03:15 -07:00
Luke Chen 191b6476d7
KAFKA-16988: add 1 more node for test_exactly_once_source system test (#16379)
Reviewers: Igor Soarez <soarez@apple.com>
2024-06-18 13:03:55 +01:00
Mickael Maison 9af6e28042
MINOR: Fix doc for zookeeper.ssl.client.enable (#16374)
Reviewers: Luke Chen <showuon@gmail.com>
2024-06-18 13:21:05 +02:00
gongxuanzhang 5a331acad0
KAFKA-10787 apply spotless to `streams:examples` and `streams-scala` (#16378)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-18 18:56:46 +08:00
dujian0068 823d6f7555
KAFKA-16958 add STRICT_STUBS to EndToEndLatencyTest, OffsetCommitCallbackInvokerTest, ProducerPerformanceTest, and TopologyTest (#16348)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-18 18:51:43 +08:00
Gaurav Narula 39b514d350
MINOR: use 2 logdirs in ZK migration system tests (#15394)
Zookeeper migration system tests currently override the config to
use only one log directory.

This PR removes the override so that the system tests run with 2 log
directories following the work done as part of KIP-858.

Reviewers: Igor Soarez <soarez@apple.com>, Proven Provenzano <pprovenzano@confluent.io>
2024-06-18 11:49:25 +01:00
TingIāu "Ting" Kì 6b341e6ca7
KAFKA-16547 Add test for DescribeConfigsOptions#includeDocumentation (#16355)
Reviewers: TaiJuWu <tjwu1217@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-18 18:45:31 +08:00
TingIāu "Ting" Kì d5592d8fe6
KAFKA-16921 [5/N] Migrate test of connect module to Junit5 (Runtime subpackage) (#16350)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-18 18:20:14 +08:00
gongxuanzhang 3a3f9ce48e
KAFKA-16921 [4/N] Migrate test of connect module to Junit5 (Runtime direct) (#16351)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-18 18:09:40 +08:00
Josep Prat a8e4caae09
MINOR: update documentation link to 3.8 (#16382)
Reviewers:  Luke Chen <showuon@gmail.com>
2024-06-18 10:26:01 +02:00
Kamal Chandraprakash 8abeaf3cb4
KAFKA-15265: Reapply dynamic remote configs after broker restart (#16353)
The below remote log configs can be configured dynamically:
1. remote.log.manager.copy.max.bytes.per.second
2. remote.log.manager.fetch.max.bytes.per.second and
3. remote.log.index.file.cache.total.size.bytes

If those values are configured dynamically, then during the broker restart, it ensures the dynamic values are loaded instead of the static values from the config.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Satish Duggana <satishd@apache.org>, Luke Chen <showuon@gmail.com>
2024-06-18 09:39:35 +05:30
Igor Soarez ceab1fe658
KAFKA-16969: Log error if config conficts with MV (#16366)
When broker configuration is incompatible with the current Metadata Version the Broker should log an error-level message but avoid shutting down.

Reviewers: Luke Chen <showuon@gmail.com>
2024-06-18 11:10:34 +08:00
Luke Chen 029bbb16e9
[MINOR] Add a note for JBOD support for tiered storage (#16369)
Reviewers: Satish Duggana <satishd@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>, Kamal Chandraprakash<kamal.chandraprakash@gmail.com>
2024-06-18 05:10:21 +05:30
Lianet Magrans 6c4e777079
KAFKA-16954: fix consumer close to release assignment in background (#16343)
This PR fixes consumer close to avoid updating the subscription state object in the app thread. Now the close simply triggers an UnsubscribeEvent that is handled in the background to trigger callbacks, clear assignment, and send leave heartbeat. Note that after triggering the event, the unsubscribe will continuously process background events until the event completes, to ensure that it allows for callbacks to run in the app thread.
The logic around what happens if the unsubscribe fails remain unchanged: close will log, keep the first exception and carry on.

It also removes the redundant LeaveOnClose event (it used to do the the exact same thing as the UnsubscribeEvent, both calling membershipMgr.leaveGroup).

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-06-17 21:27:33 +02:00
Gantigmaa Selenge 166d9e8059
KAFKA-15751, KAFKA-15752: Enable KRaft for BaseAdminIntegrationTest and SaslSslAdminIntegrationTest (#15175)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2024-06-17 19:38:52 +02:00
ChickenchickenLove 1a7ba667ad
MINOR improve startup log in QuorumController (#15926)
Reviewers: David Arthur <mumrah@gmail.com>
2024-06-17 11:04:12 -04:00
TingIāu "Ting" Kì 92d8d4bd1f
KAFKA-16970 Fix hash implementation of `ScramCredentialValue`, `ScramCredentialData`, and `ContextualRecord` (#16359)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-17 22:29:22 +08:00
gongxuanzhang 09b4ef416a
KAFKA-10787 Apply spotless to `stream:test-utils` and `:streams:upgrade-system-tests-xxxx` (#16357)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-17 19:48:44 +08:00
Dongnuo Lyu 21d60eabab
KAFKA-16673; Simplify `GroupMetadataManager#toTopicPartitions` by using `ConsumerProtocolSubscription` instead of `ConsumerPartitionAssignor.Subscription` (#16309)
In `GroupMetadataManager#toTopicPartitions`, we generate a list of `ConsumerGroupHeartbeatRequestData.TopicPartitions` from the input deserialized subscription. Currently the input subscription is `ConsumerPartitionAssignor.Subscription`, where the topic partitions are stored as (topic-partition) pairs, whereas in `ConsumerGroupHeartbeatRequestData.TopicPartitions`, we need the topic partitions to be stored as (topic-partition list) pairs.

`ConsumerProtocolSubscription` is an intermediate data structure in the deserialization where the topic partitions are stored as (topic-partition list) pairs. This pr uses `ConsumerProtocolSubscription` instead as the input subscription to make `toTopicPartitions` more efficient. 

Reviewers: David Jacot <djacot@confluent.io>
2024-06-17 02:47:52 -07:00
Chia Chuan Yu 768e90f667
KAFKA-16669 Remove extra collection copy when generating DescribeAclsResource (#15924)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-17 14:47:44 +08:00
Gaurav Narula 4a37c2e18f
KAFKA-16219 set SO_TIMEOUT in EchoServer (#16354)
We observed some runs of the test suite caused CI pipelines to stall.

A thread dump revealed that the test runner was blocked trying to read from a
socket, while attempting to close the socket [[0]]. It turns out this is
due to a bug in JDK which is very similar to JDK-8274524, but it affects
the else branch of `SSLSocketImpl::bruteForceCloseInput` [[1]] which wasn't
fixed in JDK-8274524.

Since the blocking happens in a native call, the test runner's timeouts have
no effect as the blocked test runner thread doesn't seem to respond to
interrupts.

As a mitigation in Kafka's test suite, this change adds `SO_TIMEOUT` of
30 seconds to all the TLS sockets handled by `EchoServer`. The timeout is
reasonably high for tests and a finite upper bound avoids infinite
blocking of the test suite.

[0]: https://issues.apache.org/jira/secure/attachment/13066427/timeout.log
[1]: 890adb6410/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java (L808)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-17 14:11:37 +08:00
Harry Fallows 9c7d81b436
KAFKA-10190 Set dynamic broker configs for entity default (#16280)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-17 13:53:13 +08:00
PoAn Yang a9d71d1312
KAFKA-16898 move TimeIndexTest and TransactionIndexTest to storage module (#16341)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-17 09:11:17 +08:00
PoAn Yang 9ac102596b
KAFKA-16971 Fix the incorrect format string in QuorumConfigs#parseBootstrapServer (#16358)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-17 07:55:47 +08:00
Krishna Agarwal bcf781230e
KAFKA-16932: Add documentation for the native docker image (#16338)
This PR contains the the following documentation changes for the native docker image:

in the docker/README.md: How to build, release and promote the native docker image.
in the tests/README.md: How to run system tests by bringing up kafka in the native mode.
added docker/native/README.md
added html changes for the kafka-site
added native docker image support in the docker compose files examples.

Testing:
Tested all the docker compose files with both the docker images - jvm and native
Tested the html changes locally with the kafka-site

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Vedarth Sharma <vesharma@confluent.io>
2024-06-16 14:01:13 +05:30
gongxuanzhang 4e846038a6
KAFKA-10787 Apply spotless to `metadata` and `server` and `storage` module (#16297)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-16 05:28:50 +08:00
PoAn Yang f80a5c9c2a
MINOR: migrate DescribeConsumerGroupTest to use ClusterTestExtensions (#15908)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-16 05:16:01 +08:00
Andrew Schofield fecbfb8133
KAFKA-16950: Define Persister interfaces and RPCs (#16335)
Define the interfaces and RPCs for share-group persistence. (KIP-932). This PR is just RPCs and interfaces to allow building of the broker components which depend upon them. The implementation will follow in subsequent PRs.

Reviewers:  Manikumar Reddy <manikumar.reddy@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2024-06-15 20:52:49 +05:30
Apoorv Mittal adee6bae45
KAFKA-16740: Added additional APIs for Share Partition (#16340)
Added additional APIs for SharePartition which shall be used by SharePartitionManager.

The lock API on SharePartition helps not issuing concurrent fetch request on replica manager for same SharePartition. The updateCacheAndOffsets API helps to update the cache and corresponding offsets when an exception is encountered in SharePartitionManager because of movement of Log Start Offset.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2024-06-15 12:25:05 +05:30
gongxuanzhang 3a9d877686
MINOR: refactor BuiltInPartitioner to remove mockRandom from production code (#16277)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-15 12:18:42 +08:00
gongxuanzhang d239dde8f6
KAFKA-10787 Apply spotless to raft module (#16278)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-15 11:28:36 +08:00
Francois Visconte 817da3fb5d
KAFKA-16895 fix off-by-one bug in RemoteCopyLagSegments (#16210)
Reviewers: Kamal Chandraprakash <kchandraprakash@uber.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-15 09:10:25 +08:00
Kirk True 8f86b9c4ec
KAFKA-16637 AsyncKafkaConsumer removes offset fetch responses from cache too aggressively (#16310)
Allow the committed offsets fetch to run for as long as needed. This handles the case where a user invokes Consumer.poll() with a very small timeout (including zero).

Reviewers: Andrew Schofield <aschofield@confluent.io>, Lianet Magrans <lianetmr@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-15 08:48:53 +08:00
Matthias J. Sax f80deeabbc
MINOR: update Kafka Streams docs with 3.4 KIP information (#16336)
Reviewers: Jim Galasyn <jim.galasyn@confluent.io>, Bill Bejeck <bill@confluent.io>
2024-06-14 15:01:35 -07:00
TingIāu "Ting" Kì 09bc5be63e
KAFKA-16946: Utils.getHost/getPort cannot parse SASL_PLAINTEXT://host:port (#16319)
In previous PR(#16048), I mistakenly excluded the underscore (_) from the set of valid characters for the protocol,
resulting in the inability to correctly parse the connection string for SASL_PLAINTEXT. This bug fix addresses the
issue and includes corresponding tests.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Luke Chen <showuon@gmail.com>
2024-06-14 13:07:11 -07:00
Rohan 9a239c6142
KAFKA-16955: fix synchronization of streams threadState (#16337)
Each KafkaStreams instance maintains a map from threadId to state
to use to aggregate to a KafkaStreams app state. The map is updated
on every state change, and when a new thread is created. State change
updates are done in a synchronized blocks, however the update that
happens on thread creation is not, which can raise
ConcurrentModificationException. This patch moves this update
into the listener object and protects it using the object's lock.
It also moves ownership of the state map into the listener so that
its less likely that future changes access it without locking

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-06-14 10:44:36 -07:00
Ken Huang fc6f8b6591
KAFKA-16921 [3/N] migrate connect module to junit 5 (#16330)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-15 00:37:59 +08:00
PoAn Yang 8682334b6a
KAFKA-16921 [2/N] migrate connect module to junit 5 (#16328)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-15 00:25:41 +08:00
TingIāu "Ting" Kì 4e2f26bfc6
KAFKA-16917 DescribeTopicsResult should use mutable map in order to keep compatibility (#16250)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-14 23:48:35 +08:00
Omnia Ibrahim e99da2446c
KAFKA-15853: Move KafkaConfig.configDef out of core (#16116)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-14 17:26:00 +02:00
Abhinav Dixit 8f6e0513df
KAFKA-16747: Implemented share sessions and contexts for share fetch requests (#16263)
About

KIP-932 introduces share sessions for share groups. This PR implements share sessions and contexts for incoming share fetch requests on broker. The changes include:

Defined CachedSharePartition class which are stored in share sessions.
Defined ShareSessionKey, ShareSession classes.
Defined ShareSessionCache class which caches all the share sessions and has evict policy defined as per KIP-932

Defined the 2 types of contexts -
a. ShareSessionContext - for share session fetch request.
b. FinalContext - for final share fetch request (epoch = -1).

Defined newContext function which returns the created/updated context on receiving share fetch request on broker.

Testing
The added code has been tested with the help of unit tests present in the PR.

Reviewers:  Andrew Schofield <aschofield@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2024-06-14 16:55:27 +05:30
Lianet Magrans 46714dbaed
KAFKA-16933: New consumer unsubscribe close commit fixes (#16272)
Fixes for the leave group flow (unsubscribe/close):

Fix to send Heartbeat to leave group on close even if the callbacks fail
fix to ensure that if a member gets fenced while blocked on callbacks (ex. on unsubscribe), it will clear its epoch to not include it in commit requests
fix to avoid race on the subscription state object on unsubscribe, updating it only on the background thread when the callbacks to leave complete (success or failure).
Also improving logging in this area.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Philip Nee <pnee@confluent.io>
2024-06-14 13:03:58 +02:00
Kuan-Po (Cooper) Tseng 888a177603
KAFKA-12708 Rewrite org.apache.kafka.test.Microbenchmarks by JMH (#16231)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-14 16:47:34 +08:00