Commit Graph

3228 Commits

Author SHA1 Message Date
Bruno Cadonna ff94c44e70
HOTFIX: Revert "KAFKA-18067: Kafka Streams can leak Producer client under EOS (#17931)" (#19078)
This reverts commit e8837465a5.

The commit that is reverted prevents Kafka Streams from re-initializing
its transactional producer. If an exception that fences the
transactional producer occurs, the producer is not re-initialized during
the handling of the exception. That causes an infinite loop of
ProducerFencedExceptions with corresponding rebalances.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, David Jacot
<djacot@confluent.io>
2025-03-03 11:58:56 +01:00
Janindu Pathirana 2e6e5304c0
KAFKA-18168: Adding checkpointing for GlobalKTable during restoration and closing (#18752)
To address the issue of not creating a checkpoint file during the
restoring and closing process, called the
GlobalStateUpdateTask.flushState() method in
GlobalStateUpdateTask.initialize() and GlobalStateUpdateTask.close()
methods. This will flush the state and create a checkpoint file thereby,
avoiding the need to completely restore the entire state.

Reviewers: Alieh Saeedi <asaeedi@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2025-03-02 12:16:48 -08:00
A. Sophie Blee-Goldman f20f299492
KAFKA-18839: Drop EAGER rebalancing support in Kafka Streams (#18988)
In 3.1 we deprecated the eager rebalancing protocol and marked it for
removal in a later release. We aim to officially drop support and remove
the protocol from Streams in 4.0.

The effect of this PR is that it will no longer be possible to perform a
live upgrade Kafka Streams directly to 4.0 from version 2.3 or below.
Users will have to go through a bridge release between 2.4 - 3.9
instead.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-02-25 19:05:03 -08:00
Sebastien Viale 3ce5f23295
KAFKA-18023: Enforcing Explicit Naming for Kafka Streams Internal Topics (#18233)
Pull request to implement KIP-1111, aims to add a configuration that
prevents a Kafka Streams application from starting if any of its
internal topics have auto-generated names, thereby enforcing explicit
naming for all internal topics and enhancing the stability of the
application’s topology.

- Repartition Topics:

All repartition topics are created in the
KStreamImpl.createRepartitionedSource(...) static method. This method
either receives a name explicitly provided by the user or null and then
builds the final repartition topic name.

- Changelog Topics and State Store Names:

There are several scenarios where these are created:
  In the MaterializedInternal constructor.
  During KStream/KStream joins.
  During KStream/KTable joins with grace periods.
  With key-value buffers are used in suppressions.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Sophie Blee-Goldman <sophie@responsive.dev>
2025-02-24 11:41:42 +01:00
Sushant Mahajan 3fc103b48b
KAFKA-18629: ShareGroupDeleteState admin client impl. (#18928)
* In this PR, we add various infra classes needed to support the
`deleteShareGroups` functionality via the `kafka-share-groups.sh`
script, as well as the implementation of `kafka-share-groups.sh --delete`.

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-02-22 16:21:10 +00:00
Matthias J. Sax acea35ddf3
MINOR: cleanup SinkNode generics (#18975)
Reviewers: Andrew Schofield <aschofield@confluent.io>, Bill Bejeck <bill@confluent.io>
2025-02-20 17:47:39 -08:00
Matthias J. Sax 9f23b25f6e
MINOR: fix Kafka Streams "smoke test" pass criteria (#18835)
Reviewers: Bill Bejeck <bill@confluent.io>, Bruno Cadonna <bruno@confluent.io>
2025-02-19 14:33:31 -08:00
Matthias J. Sax 538a60e1b3
MINOR: disallow rawtypes and fail build (#18877)
Cleanup code to avoid rawtype, and add suppressions where necessary.
Change the build to fail on rawtype warning.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Andrew Schofield <aschofield@confluent.io>
2025-02-19 13:11:49 -08:00
Matthias J. Sax 900d81b345
MINOR: cleanup top level class JavaDocs for main interfaces of Kafka Streams DSL (4/N) (#18884)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-18 16:22:18 -08:00
Matthias J. Sax 490ba8a8a3
MINOR: cleanup top level class JavaDocs for main interfaces of Kafka Streams DSL (3/N) (#18883)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-18 16:21:52 -08:00
Matthias J. Sax d6146644b3
MINOR: verify that internal StreamsConfig members are not public (#18840)
Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2025-02-18 16:18:29 -08:00
Matthias J. Sax 87f797811b
HOTFIX: StoreChangelogReader should require stable consumer group (#18901)
Fixing regression bug, introduced by beac86f049

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bruno Cadonna <bruno@confluent.io>
2025-02-17 12:53:13 -08:00
Matthias J. Sax 36fd33a9d9 HOTFIX: fix broken :streams:javadocs target 2025-02-14 15:18:11 -08:00
Matthias J. Sax bcc58b4cfe
MINOR: cleanup top level class JavaDocs for main interfaces of Kafka Streams DSL (2/N) (#18882)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-14 13:47:23 -08:00
Matthias J. Sax 835d8f3097
MINOR: cleanup top level class JavaDocs for main interfaces of Kafka Streams DSL (1/N) (#18881)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-14 13:46:27 -08:00
Jimmy Wang 6a6b80215d
KAFKA-16717 [1/2]: Add AdminClient.alterShareGroupOffsets (#18819)
KAFKA-16720 aims to add the support for the AlterShareGroupOffsets AdminClient. Key Changes in the PR:

1. Added handing of alterShareGroupOffsets() in KafkaAdminClient and introduce AlterShareGroupOffsetRequest/AlterShareGroupOffsetResponse/AlterShareGroupOffsetsOptions classes.
2. Corresponding test in KafkaAdminClientTest.
3. Added ALTER_SHARE_GROUP_OFFSETS API (will finish it in next PR and the share coordinator pieces)

Reviewers: poorv Mittal <apoorvmittal10@gmail.com>, Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2025-02-15 02:35:46 +08:00
Bill Bejeck 3aae6f5402
MINOR: Adjust javadoc to reflect the correct status of standby task TopicPartition (#18892)
KIP-744 introduced the StreamsMetadata class as part of the implementation. In the KIP, the javadoc for the standbyTopicPartitions states that the method returns the set of source TopicPartition that it represents as a standby. The current javadoc states that it represents the changelog TopicPartition(s). While the partitions of the source and changelog topics will match, the javadoc needs to be updated to reflect the correct behavior.

Note that the deprecated o.a.k.streams.state.StreamsMetadata#standbyTopicPartitions method also describes the set of TopicPartition being source TopicPartition.

Reviewers: Matthias Sax<mjsax@apache.org>
2025-02-13 14:06:01 -05:00
Matthias J. Sax 9fbf14d544
MINOR: fix warn log message in Kafka Streams (#18878)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bill Bejeck <bill@confluent.io>
2025-02-13 09:30:07 -08:00
Matthias J. Sax 6a050c6351
MINOR: cleanup KStream JavaDocs (14/N) - stream-globalTable-left-join (#18867)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-12 14:51:48 -08:00
Matthias J. Sax f67edf13a7
MINOR: cleanup KStream JavaDocs (13/N) - stream-stream-outer-join (#18865)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-12 13:02:01 -08:00
Matthias J. Sax ce8b08cf22
MINOR: cleanup KStream JavaDocs (12/N) - process[Values] (#18839)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-11 11:09:22 -08:00
Matthias J. Sax a6ec758488
MINOR: cleanup KStream JavaDocs (11/N) - stream-stream-left-join (#18836)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-11 10:16:28 -08:00
Kuan-Po Tseng e53af1a489
MINOR: fix KStream#to incorrect javadoc (#18838)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-02-10 22:10:36 +08:00
Matthias J. Sax 8b22f10083
MINOR: cleanup KStream JavaDocs (10/N) - stream-table-left-join (#18813)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-07 17:58:16 -08:00
Matthias J. Sax 33bba9ef4a
MINOR: cleanup KStream JavaDocs (9/N) - flatMap[Values] (#18805)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-02-07 14:41:03 -08:00
Matthias J. Sax 326ee368ba
MINOR: cleanup KStream JavaDocs (5/N) - stream-globalTable-inner-join (#18747)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-02-07 13:44:50 -08:00
Lucas Brutschy 8d294cf709 MINOR: Fix streams smoke test flush records (#18830)
In the streams smoke test, flush records that are appended to the input topics, to advance the stream time so that all suppressed windows are flushed at the end of the test. The records are created with record time equal to current time + 2 days. caf0b67 changed the broker defaults so that records more than one hour in the future are rejected by the broker. This breaks the flush messages. By moving all record time stamps 2 days into the past, the existing logic should work correctly with the new default broker configuration.

A similar thing happens in the relational smoke test, where data is emitted 4 days into the future. To avoid running into retention / compaction, the window retention time is increased for both tests.

Reviewers: Bruno Cadonna <bruno@confluent.io>, Bill Bejeck <bill@confluent.io>
2025-02-07 13:21:55 -08:00
Gyeongwon, Do 557c17bfbc
MINOR: Refactor method name for consistency (#18779)
Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-02-07 20:07:34 +00:00
Matthias J. Sax 780640f383
MINOR: cleanup KStream JavaDocs (8/N) - stream-stream-inner-join (#18761)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-02-06 10:58:29 -08:00
Matthias J. Sax bdab927a7d
MINOR: cleanup KStream JavaDocs (7/N) - repartition/to/toTable (#18760)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-02-06 10:57:54 -08:00
Steven Schlansker 852f14065b
KAFKA-18689: Improve metric calculation to avoid NoSuchElementException (#18771)
Reviewers: Nick Telford <nick.telford@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2025-02-05 21:39:30 -08:00
Matthias J. Sax 9774635bfd
MINOR: update Kafka Streams `Topology` JavaDocs (#18778)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-02-05 20:24:14 -08:00
Joao Pedro Fonseca Dantas 8be2a8ed4e
MINOR: Add javadocs to AbstractMergedSortedCacheStoreIterator (#18772)
While reviewing PR #18287, I wrote some javadocs to help me understand the AbstractMergedSortedCacheStoreIterator. Maybe we could add them to help the next developers getting into it.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2025-02-05 17:20:53 -08:00
Lucas Brutschy 102de21355
KAFKA-17379: Fix inexpected state transition from ERROR to PENDING_SHUTDOWN (#18765)
The exception stack trace shown in the the ticket can happen when we are
concurrently closing the producer because of an error and doing a
regular close. This is not a bug in the test, but a real race condition
that can happen.

The sequence is this:

Thread1: Enter PENDING_ERROR
Thread2: Check if state is already ERROR
Thread1: Transition to ERROR
Thread2: Check if state is already PENDING_ERROR
Thread2: Transition to PENDING_SHUTDOWN

One idea to fix this would be to synchronize the sequence performed by
Thread1 using the state lock. However, this would require more changes,
since we cannot use the normal state transition method `setState` while
owning the lock, as it calls user-defined callbacks, which may create
deadlocks. Do avoid adding more synchronization, we can also fix it by
first attempting to transition to PENDING_SHUTDOWN, and _then_ checking
whether another thread is already attempting to shut down (states
PENDING_SHUTDOWN, PENDING_ERROR, ERROR, NOT_RUNNING). Since we never
transition from a shutdown state back to a non-shutdown state.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-02-05 17:09:14 +01:00
Matthias J. Sax a1d5dc0f9e HOTFIX: compilation error
Two merged PRs overlapped in a non-conflicting way, breaking compilation:
 - https://github.com/apache/kafka/pull/18722
 - https://github.com/apache/kafka/pull/18755
2025-02-04 20:32:52 -08:00
Matthias J. Sax 5988ee551e
MINOR: cleanup KStream JavaDocs (6/N) - map[Values] (#18755)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-02-04 19:57:59 -08:00
Matthias J. Sax 8e3a001bf5
MINOR: disable "processing threads" in SmokeTestDriverIntegrationTest (#18773)
Reviewers: Bruno Cadonna <bruno@confluent.io>
2025-02-04 09:59:14 -08:00
Matthias J. Sax 7719b5f70d
KAFKA-18644: improve generic type names for internal FK-join classes (#18700)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-02-03 22:20:47 -08:00
Matthias J. Sax 65961516fd
MINOR: cleanup KStream JavaDocs (4/N) - stream-table-inner-join (#18721)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Bill Bejeck <bill@confluent.io>
2025-02-03 17:48:49 -08:00
Matthias J. Sax b8cafbfe2d
MINOR: Session windows should accept zero as session gap (#18734)
Reviewers: Almog Gavra <almog@responsive.dev>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2025-02-03 17:45:27 -08:00
Matthias J. Sax ce6f078192
MINOR: fix NPE in KS `Topology` for new `AutoOffsetReset` (#18780)
Introduced via KIP-1106.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-02-03 17:24:47 -08:00
Matthias J. Sax 281a3c6a3a
MINOR: cleanup KStream JavaDocs (3/N) - groupBy[Key] (#18705)
Reviewers: Alieh Saeedi <asaeedi@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2025-01-30 19:52:14 -08:00
Matthias J. Sax 0d1e7e04b2
KAFKA-18644: improve generic type names for KStreamImpl and KTableImpl (#18722)
Reviewers: Bill Bejeck <bill@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2025-01-30 19:50:37 -08:00
Joao Pedro Fonseca Dantas 9980e12ce1
MINOR: remove close from contextual processors javadoc
Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-01-30 11:02:07 -08:00
Matthias J. Sax ea07ff7694
MINOR: cleanup KStream JavaDocs (2/N) - print/foreach/peek/split/merge (#18704)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-01-30 09:32:57 -08:00
Matthias J. Sax a916a1db82
MINOR: cleanup KStream JavaDocs (1/N) - filter[Not]/selectKey (#18703)
Reviewers: Alieh Saeedi <asaeedi@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2025-01-30 09:31:47 -08:00
Matthias J. Sax 1123a76110
KAFKA-13722: remove internal usage of old ProcessorContext (#18698)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-01-29 11:13:57 -08:00
Bill Bejeck 20b073bbee
KAFKA-18498: Update lock ownership from main thread (#18732)
Once a StreamThread receives its assignment, it will close the startup tasks. But during the closing process, the StandbyTask.closeClean() method will eventually call theStatemanagerUtil.closeStateManager method which needs to lock the state directory, but locking requires the calling thread be the current owner. Since the main thread grabs the lock on startup but moves on without releasing it, we need to update ownership explicitly here in order for the stream thread to close the startup task and begin processing.

Reviewers: Matthias Sax <mjsax@apache.org>, Nick Telford
2025-01-29 14:09:44 -05:00
Matthias J. Sax dc396f47e8
KAFKA-17162: join() started thread in DefaultTaskManagerTest (#18570)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-01-27 16:48:07 -08:00
Matthias J. Sax ee4f8f8c42
KAFKA-18541: fix flaky KafkaStreamsTelemetryIntegrationTest (#18569)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-01-27 09:43:25 -08:00