Commit Graph

3358 Commits

Author SHA1 Message Date
Ken Huang ebae768bd8
KAFKA-18193 Refactor Kafka Streams CloseOptions to Fluent API Style (#19955)
In Kafka Streams, configuration classes typically follow a fluent API
pattern to ensure a consistent and intuitive developer experience.
However, the current implementation of
`org.apache.kafka.streams.KafkaStreams$CloseOptions` deviates from this
convention by exposing a public constructor, breaking the uniformity
expected across the API.

To address this inconsistency, we propose introducing a new
`CloseOptions` class that adheres to the fluent API style, replacing the
existing implementation. The new class will retain the existing
`timeout(Duration)` and `leaveGroup(boolean)` methods but will enforce
fluent instantiation and configuration. Given the design shift, we will
not maintain backward compatibility with the current class.

This change aligns with the goal of standardizing configuration objects
across Kafka Streams, offering developers a more cohesive and
predictable API.

Reviewers: Bill Bejeck<bbejeck@apache.org>
2025-10-07 08:50:18 -04:00
Jinhe Zhang 611f4128b4
MINOR: Enable streams rebalance protocol in EosIntegrationTest (#20592)
CI / build (push) Waiting to run Details
Remove stalling instance in EOSIntegrationTest, since it doesn’t matter
what it thinks what the assignment is but blocks the test with streams
group protocol

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-10-05 15:55:59 +02:00
Matthias J. Sax 0dd8471174
KAFKA-19748: fix metrics leak in Kafka Streams (#20633)
CI / build (push) Waiting to run Details
This PR fixes a leak in StreamsMetricImpl not removing a
store-level-metric correctly, and thus leaking objects.

Reviewers: Eduwer Camacaro <eduwerc@gmail.com>, Bill Bejeck
 <bbejeck@apache.org>
2025-10-03 15:27:51 -07:00
Nikita Shupletsov 7ddd0d7cce
KAFKA-19703: Removed versions 2.3 and below from UpgradeFromValues. (#20539)
Removed versions 2.3 and below from UpgradeFromValues, including all the
usagesof them.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-10-03 15:00:56 -07:00
TengYao Chi 68f1da8474
KAFKA-18185: remove internal.leave.group.on.close config (#19400)
CI / build (push) Waiting to run Details
JIRA: KAFKA-18185

This is a follow-up of #17614   The patch is to remove the
`internal.leave.group.on.close` config.

Reviewers: Sophie Blee-Goldman <ableegoldman@gmail.com>, Chia-Ping Tsai
 <chia7712@gmail.com>, Bill Bejeck <bbejeck@apache.org>
2025-10-03 13:21:38 -04:00
Nikita Shupletsov 28e7803037
KAFKA-19744: Move restore time calculation to ChangelogMetadata (#20613)
CI / build (push) Waiting to run Details
- Move restore time calculation to ChangelogMetadata.
- Introduced a new interface to propagate the calculated value to the
stores to avoid modifications in the public interface.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-10-02 21:24:36 -07:00
Lan Ding 1ebca7817b
KAFKA-19539: Kafka Streams should also purge internal topics based on user commit requests (#20234)
Repartition topic records should be purged up to the currently committed
offset once `repartition.purge.interval.ms` duration has passed.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-09-29 08:26:49 -07:00
Deep Golani 71c5a426b8
KAFKA-12506: Strengthen AdjustStreamThreadCountTest with stateful counting and higher throughput (#20540)
Add count store and output topic; produce 1,000 records across 50 keys
to better exercise concurrency.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-09-29 08:23:05 -07:00
Lucas Brutschy 1f7631c8c6
MINOR: Fix StreamsRebalanceListenerInvoker (#20575)
StreamsRebalanceListenerInvoker was implemented to match the behavior of
ConsumerRebalanceListenerInvoker, however StreamsRebalanceListener has a
subtly different interface than ConsumerRebalanceListener - it does not
throw exceptions, but returns it as an Optional.

In the interest of consistency, this change fixes this mismatch by
changing the StreamsRebalanceListener interface to behave more like the
ConsumerRebalanceListener - throwing exceptions directly.

In another minor fix, the StreamsRebalanceListenerInvoker is changed to
simply skip callback execution instead of throwing an
IllegalStateException when no streamRebalanceListener is defined. This
can happen when the consumer is closed before Consumer.subscribe is
called.

Reviewers: Lianet Magrans <lmagrans@confluent.io>, Matthias J. Sax
 <matthias@confluent.io>
2025-09-24 09:03:07 +02:00
Matthias J. Sax 71efb89290
MINOR: fix incorrect offset reset logging (#20558)
We need to only pass in the reset strategy, as the `logMessage`
parameter was removed.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Lucas Brutschy
 <lbrutschy@confluent.io>
2025-09-22 18:54:50 +02:00
Jinhe Zhang 04b4a8f571
KAFKA-19705: Enable streams rebalance protocol in IQv2 integration test (#20541)
Update IQv2 Integration tests for streams group protocol

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-09-18 09:41:52 +02:00
Shivsundar R 3bc50f937c
KAFKA-19623: Implement KIP-1147 for console producer/consumer/share-consumer. (#20479)
*What*
https://issues.apache.org/jira/browse/KAFKA-19623

- The PR implements KIP-1147

(https://cwiki.apache.org/confluence/display/KAFKA/KIP-1147%3A+Improve+consistency+of+command-line+arguments)
for the console tools i.e. `ConsoleProducer`, `ConsoleConsumer` and
`ConsoleShareConsumer`.

- Currently the previous names for the options are still usable but
there will be warning message stating those are deprecated and will be
removed in a future version.
- I have added unit tests and also manually verified using the console
tools that things are working as expected.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Jhen-Yung Hsu
 <jhenyunghsu@gmail.com>, Jimmy Wang
 <48462172+JimmyWang6@users.noreply.github.com>
2025-09-17 15:28:20 +01:00
Shashank b043ca2074
KAFKA-19683: Remove dead tests and modify tests in TaskManagerTest [1/N] (#20501)
This is the first part of cleaning up of the tests in `TaskManagerTest`
- Removed dead tests
- Added new tests as suggested earlier

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-09-16 20:46:20 +02:00
Lucas Brutschy 2c347380b7
KAFKA-19694: Trigger StreamsRebalanceListener in Consumer.close (#20511)
In the consumer, we invoke the consumer rebalance onPartitionRevoked or
onPartitionLost callbacks, when the consumer closes. The point is that
the application may want to commit, or wipe the state if we are closing
unsuccessfully.

In the StreamsRebalanceListener, we did not implement this behavior,
which means when closing the consumer we may lose some progress, and in
the worst case also miss that we have to wipe our local state state
since we got fenced.

In this PR we implement StreamsRebalanceListenerInvoker, very similarly
to ConsumerRebalanceListenerInvoker and invoke it in Consumer.close.

Reviewers: Lianet Magrans <lmagrans@confluent.io>, Matthias J. Sax
 <matthias@confluent.io>, TengYao Chi <frankvicky@apache.org>,
 Uladzislau Blok <123193120+UladzislauBlok@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-16 16:32:47 +02:00
Lucas Brutschy 20268330d5
MINOR: Deflake and improve SmokeTestDriverIntegrationTest (#20509)
This improves the SmokeTestDriverIntegrationTest in three ways:

1) If a SmokeTestClient fails (enters a terminal ERROR state), the
SmokeTestDriverIntegrationTest currently times out, because it keeps
waiting for state NOT_RUNNING. This makes debugging quite difficult.
This minor  change makes sure to just fail the test immediately, if a
SmokeTestClient enters the ERROR state.

2) If a test times out or fails prematurely, because a SmokeTestClient
crashed, the SmokeTestClients aren't shut down correctly, which will
affect the following test runs. Therefore, I am adding clean-up logic
that running SmokeTestClients in `@AfterAll`.

3) Finally, I found that the processingThread variation of this thread
triggers a subtle race condition. Since this features is currently not
actively developed, I disabled those variations and created a ticket to
reactivate the test.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Chia-Ping Tsai
 <chia7712@gmail.com>, Bill Bejeck <bill@confluent.io>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-12 10:31:19 +02:00
Shashank dd824a2e74
KAFKA-19666: Remove old restoration codepath from RestoreIntegrationTest [4/N] (#20498)
Clean up `RestoreIntegrationTest.java`

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-09-11 16:06:25 +02:00
Mickael Maison 865beb6ede
MINOR: Remove explicit version list from upgrade.from docs (#20518)
That config has a `Validator` so we already automatically print the
valid values in the generated docs:
https://kafka.apache.org/documentation/#streamsconfigs_upgrade.from

That will be one less place to upgrade each time we make a new release.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-09-10 20:47:11 +02:00
Shashank 709c5fab22
KAFKA-19666: Remove old restoration codepath from EosIntegrationTest [5/N] (#20499)
clean up `EosIntegrationTest.java`

Reviewers: Lucas Brutschy <lucasbru@apache.org>
2025-09-10 17:10:46 +02:00
Mickael Maison 32b8e326da
MINOR: Add 4.1.0 to streams system tests (#20480)
This PR updates all the streams system tests to include 4.1.0.

Reviewers: Lucas Brutschy <lucasbru@apache.org>
2025-09-10 16:23:55 +02:00
Nikita Shupletsov 8015c87390
KAFKA-19679: Fix NoSuchElementException in oldest open iterator metric (#20512)
Querying the oldest-open-iterator metric can result in a
NoSuchElementException when the last open iterator gets removed, due to
a race condition between the query and the metric update.

To avoid this race condition, this PR caches the metric result, to avoid
accessing the list of open iterator directly.  We don't need to clear
this cache, because the entire metric is removed when the last iterator
gets removed.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-09-09 21:18:00 -07:00
Lucas Brutschy 620a01b74b
KAFKA-19661 [4/N]: Prefer range-style assignment (#20486)
This is actually fixing a difference between the old and the new
assignor. Given the assignment ordering, the legacy assignor has a
preference for range-style assignments built in, that is, assigning

C1: 0_0, 1_0  C2: 0_1, 1_1

instead of

C1: 0_0, 0_1  C2: 1_0, 1_1

We add tests to both assignors to check for this behavior, and improve
the new assingor by enforcing corresponding orderings.

Reviewers: Bill Bejeck <bill@confluent.io>
2025-09-09 10:44:37 +02:00
Shashank f7593db287
KAFKA-19666: Remove old restoration codepath from SmokeTestDriverIntegrationTest [3/N] (#20465)
clean up `SmokeTestDriverIntegrationTest`

Reviewers: Lucas Brutschy <lucasbru@apache.org>
2025-09-08 17:48:37 +02:00
Jinhe Zhang b3eed51023
KAFKA-19660: JoinWithIncompleteMetadataIntegrationTest fails in isolated run of one parameter (#20483)
The original test timeout when using new protocol, because it use
`ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG` as the exception's timeout,
which is 300s. Also the test for new protocol and old protocol use the
same group ID, so the failure will be hidden.
What I do:
1. Set the timeout as 5 secs so it can be captured within 10s
2. Use new appId for new protocol

Reviewers: Lucas Brutschy <lucasbru@apache.org>
2025-09-08 17:02:11 +02:00
Shashank 24ea7e0b00
KAFKA-19666: Remove old restoration codepath from PauseResumeIntegrationTest [2/N] (#20463)
Clean up `PauseResumeIntegrationTest`

Reviewers: Lucas Brutschy <lucasbru@apache.org>
2025-09-08 09:18:12 +02:00
Matthias J. Sax 655cfaa7b6
MINOR: remove System.out in test (#20494)
This PR removes two System.out.println(...) statements from
StreamsGraphTest. These outputs were left over from debugging and are
not needed in the test logic.

Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi
 <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-09-06 23:24:54 +08:00
Matthias J. Sax 9ba7dd68e6
KAFKA-19668: processValue() must be declared as value-changing operation (#20470)
With "merge.repartition.topic" optimization enabled, Kafka Streams tries
to push repartition topics upstream, to be able to merge multiple
repartition topics from different downstream branches together.

However, it is not safe to push a repartition topic if the parent node
is value-changing: because of potentially changing data types, the
topology might become invalid, and fail with serde error at runtime.

The optimization itself work correctly, however, processValues() is not
correctly declared as value-changing, what can lead to invalid
topologies.

Reviewers: Bill Bejeck <bill@confluent.io>, Lucas Brutschy
 <lbrutschy@confluent.io>
2025-09-05 18:00:24 -07:00
Ken Huang 0a12eaa80e
KAFKA-19112 Unifying LIST-Type Configuration Validation and Default Values (#20334)
We add the three main changes in this PR

- Disallowing null values for most LIST-type configurations makes sense,
since users cannot explicitly set a configuration to null in a
properties file. Therefore, only configurations with a default value of
null should be allowed to accept null.
- Disallowing duplicate values is reasonable, as there are currently no
known configurations in Kafka that require specifying the same value
multiple times. Allowing duplicates is both rare in practice and
potentially confusing to users.
- Disallowing empty list, even though many configurations currently
accept them. In practice, setting an empty list for several of these
configurations can lead to server startup failures or unexpected
behavior. Therefore, enforcing non-empty lists helps prevent
misconfiguration and improves system robustness.
These changes may introduce some backward incompatibility, but this
trade-off is justified by the significant improvements in safety,
consistency, and overall user experience.

Additionally, we introduce two minor adjustments:

- Reclassify some STRING-type configurations as LIST-type, particularly
those using comma-separated values to represent multiple entries. This
change reflects the actual semantics used in Kafka.
- Update the default values for some configurations to better align with
other configs.
These changes will not introduce any compatibility issues.

Reviewers: Jun Rao <junrao@gmail.com>, Chia-Ping Tsai
 <chia7712@gmail.com>
2025-09-06 01:25:55 +08:00
Shashank d68c41d2f3
KAFKA-19666: Clean up integration tests related to state-updater (#20462)
Clean up `KafkaStreamsTelemetryIntegrationTest.java`

Reviewers: Lucas Brutschy <lucasbru@apache.org>
2025-09-04 21:40:23 +02:00
Lucas Brutschy 6247fd9eb3
KAFKA-19478 [3/N]: Use heaps to discover the least loaded process (#20172)
The original implementation uses a linear search to find the least
loaded process in O(n), and we can replace this by look-ups in a heap is
O(log(n)), as described below

Active tasks: For active tasks, we can do exactly the same assignment as
in the original algorithm by first building a heap (by load) of all
processes. When we assign a task, we pick the head off the heap, assign
the task to it, update the load, and re-insert it into the heap in
O(log(n)).

Standby tasks: For standby tasks, we cannot do this optimization
directly, because of the order in which we assign tasks:

1. We first try to assign task A to a process that previously owned A.
2. If we did not find such a process, we assign A to the least loaded
node.
3. We now try to assign task B to a process that previously owned B
4. If we did not find such a process, we assign B to the least loaded
node
   ...

The problem is that we cannot efficiently keep a heap (by load)
throughout this process, because finding and removing process that
previously owned A (and B and…) in the heap is O(n). We therefore need
to change the order of evaluation to be able to use a heap:

1. Try to assign all tasks A, B.. to a process that previously owned the
task
2. Build a heap.
3. Assign all remaining tasks to the least-loaded process that does not
yet own the task. Since at most NumStandbyReplicas already own the task,
we can do it by removing up to NumStandbyReplicas from the top of the
heap in O(log(n)), so we get O(log(NumProcesses)*NumStandbyReplicas).

Note that the change in order changes the resulting standby assignments
(although this difference does not show up in the existing unit tests).
I would argue that the new order of assignment will actually yield
better assignments, since the assignment will be more sticky, which has
the potential to reduce the amount of store we have to restore from the
changelog topic after assingments.

In our worst-performing benchmark, this improves the runtime by ~107x.

Reviewers: Bill Bejeck<bbejeck@apache.org>
2025-09-03 17:13:01 +02:00
Matthias J. Sax 342a8e6773
MINOR: suppress build warning (#20424)
Suppress build warning.

Reviewers: TengYao Chi <frankvicky@apache.org>, Ken Huang
<s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-09-01 11:12:11 -07:00
Lucas Brutschy 3c378dab7d
KAFKA-19647: Implement integration test for offline migration (#20412)
In KAFKA-19570 we implemented offline migration between groups, that is,
the following integration test or system test should be possible:

Test A:

 - Start a streams application with classic protocol, process up to a
certain offset and commit the offset and shut down.   - Start the same
streams application with streams protocol (same app ID!).   - Make sure
that the offsets before the one committed in the first run are not
reprocessed in the second run.

Test B:

 - Start a streams application with streams protocol, process up to a
certain offset and commit the offset and shut down.   - Start the same
streams application with classic protocol (same app ID!).   - Make sure
that the offsets before the one committed in the first run are not
reprocessed in the second run.

We have unit tests that make sure that non-empty groups will not be
converted. This should be enough.

Reviewers: Bill Bejeck <bbejeck@apache.org>
2025-08-28 17:07:58 +02:00
TengYao Chi 74b2228dd7
MINOR: Add a missing @Test to test case "shouldCallOldImplementationExceptionHandler" (#20427)
`shouldCallOldImplementationExceptionHandler` should be a test case, but
somehow misses the `@Test` tag

Reviewers: Ken Huang <s7133700@gmail.com>, TaiJuWu <tjwu1217@gmail.com>,
 Chia-Ping Tsai <chia7712@gmail.com>
2025-08-28 15:22:23 +08:00
Lucas Brutschy 0412be9e9d
KAFKA-19641: Fix flaky RestoreIntegrationTest#shouldInvokeUserDefinedGlobalStateRestoreListener (#20419)
What I observed is that if I run both combinations useNewProtocol=true,
useNewProtocol=false it would often fail the second time, but if I only
run the second variation useNewProtocol=false it works, and only the
first variation useNewProtocol=true also works. So this points to some
state that is not cleared between the tests  - and indeed, the test
creates a topic “inputTopic”, produces to it, but doesn’t delete it, so
the second variation will run with produce to it again and then run with
twice the data.

I also reduced heartbeat interval and session timeout since some of the
tests need to wait for the old consumer to leave which (sigh) Kafka
Streams doesn't do, so we have to wait that it gets kicked out by
session timeout. So previously we waited for 45 seconds, now, we at
least wait only 1 second.

Reviewers: Bill Bejeck <bbejeck@apache.org>, Chia-Ping Tsai
<chia7712@gmail.com>
2025-08-27 20:18:50 +02:00
Sebastien Viale 04518f4ce1
KAFKA-19531 Add an end-to-end integration test for the DLQ feature (#20236)
This PR adds an end-to-end integration tests that validates the Dead
Letter Queue (DLQ) feature introduced in

[KIP-1034](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1034%3A+Dead+letter+queue+in+Kafka+Streams)

Reviewers: Lucas Brutschy <lucasbru@apache.org>
2025-08-27 18:54:21 +02:00
Jinhe Zhang b8bd50a06d
MINOR: Port RestoreIntegrationTest to the new protocol (#20347)
The test uses regular consumer to commit offsets. New protocol requires
a streams consumer since we are using streams groups, otherwise we run
into group ID conflicts.

Followed the addition of the KafkaAdmin interface for setting offsets, a
Kafka Admin client is created and used the interface in to set the
committed offsets instead of instantiating a consumer.

Also enable all tests for stream new protocol.

Reviewers: Alieh Saeedi<asaeedi@confluent.io>, Kirk True
 <ktrue@confluent.io>, Matthias Sax <mjsax@apache.org>, Bill Bejeck
 <bbejeck@apache.org>
2025-08-22 11:39:43 -04:00
Jinhe Zhang 03190e4c22
MINOR: retry upon missing source topic (#20284)
Implements a timeout mechanism (using maxPollTimeMs) that waits for
missing source topics to be created before failing, instead of
immediately  throwing exceptions in the new Streams protocol.
Additionally, throw  TopologyException when partition count mismatch is
detected.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Alieh Saeedi
 <asaeedi@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2025-08-06 15:32:48 -07:00
Lucas Brutschy 44c6e956ed
KAFKA-19529: State updater sensor names should be unique (#20262)
CI / build (push) Waiting to run Details
All state updater threads use the same metrics instance, but do not use
unique names for their sensors. This can have the following symptoms:

1) Data inserted into one sensor by one thread can affect the metrics of
all state updater threads.
2) If one state updater thread is shutdown, the metrics associated to
all state updater threads are removed.
3) If one state updater thread is started, while another one is removed,
it can happen that a metric is registered with the `Metrics` instance,
but not associated to any `Sensor` (because it is concurrently removed),
which means that the metric will not be removed upon shutdown. If a
thread with the same name later tries to register the same metric, we
may run into a `java.lang.IllegalArgumentException: A metric named ...
already exists`, as described in the ticket.

This change fixes the bug giving unique names to the sensors. A test is
added that there is no interference of the removal of sensors and
metrics during shutdown.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-07-31 08:58:52 +02:00
Jinhe Zhang 81bdf0b889
MINOR: Remove duplicated code in PgeViewDemo (#20252)
CI / build (push) Waiting to run Details
Remove the default implementation

Reviewers: Lucas Brutschy <lucasbru@apache.org>
2025-07-29 18:18:38 +02:00
Uladzislau Blok f9ccf83a7f
KAFKA-18066: Fix mismatched StreamThread ID in log messages (#19517)
CI / build (push) Waiting to run Details
This PR fixes an issue where the thread name shown in log messages did
not match the actual execution context. Previously, log entries
displayed the context of the newly created thread, while the logger
reflected the current executing thread. This mismatch led to confusion
and made log tracing more difficult.

Changes:
 - Use logger without context to not have context
 - Updated log messages to explicitly describe the thread being created
- Fixed instances where the log context reflected the current thread
instead of the newly created one
 
 Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-07-28 17:00:50 -07:00
Rajani K de2adb69de
KAFKA-12281: Deprecate BrokerNotFoundException (#20192)
CI / build (push) Waiting to run Details
Implements KIP-1195.

BrokerNotFoundException exception is unused since 2.8  Marking it
deprecated so that it can be removed in next major release.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-07-28 15:18:34 -07:00
Jinhe Zhang 73f195f062
MINOR: Re-add pageview demo to :streams:examples and remove dependency on :connect:json (#20239)
CI / build (push) Has been cancelled Details
With 4.0 release, we remove pageview demo because it depends on
`:connect:json` which requires JDK 17.  This PR removes the connect
dependency and adds a customized serializer and deserializer,  to make
pageview demo works with JDK 11.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-07-25 11:06:12 -07:00
Maros Orsak 8614e15a28
MINOR: typo in javadoc (#20113)
CI / build (push) Waiting to run Details
Fixup PR Labels / fixup-pr-labels (needs-attention) (push) Has been cancelled Details
Fixup PR Labels / fixup-pr-labels (triage) (push) Has been cancelled Details
Fixup PR Labels / needs-attention (push) Has been cancelled Details
This PR fixes a typo in the Javadoc.

---------

Signed-off-by: see-quick <maros.orsak159@gmail.com>

Reviewers: Luke Chen <showuon@gmail.com>
2025-07-24 19:05:07 +08:00
Chang-Chi Hsu 0086f24101
MINOR: Declare the inner RocksDBDualCFRangeIterator class as static (#20220)
Make inner classes static.

from: https://github.com/apache/kafka/pull/20182#issuecomment-3102893453

Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai
<chia7712@gmail.com>
2025-07-23 21:37:48 +08:00
Jinhe Zhang ed22a8b6cb
MINOR: Fix StreamThreadTest (#20210)
There is a typo in the unit test, it calls
`runOnceWithoutProcessingThreads` while it should call
`runOnceWithProcessingThreads` instead.

Reviewers: Lucas Brutschy <lucasbru@apache.org>
2025-07-22 11:04:23 +02:00
Gasparina Damien cdc2d957ed
KAFKA-16505: Adding dead letter queue in Kafka Streams (#17942)
Implements KIP-1034 to add support of Dead Letter
Queue in Kafka Streams. 

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Bruno Cadonna
 <cadonna@apache.org>
Co-authored-by: Sebastien Viale <sebastien.viale@michelin.com>
2025-07-21 15:54:40 +02:00
Jinhe Zhang 38e3359446
KAFKA-19511: Fix flaky test HandlingSourceTopicDeletionIntegrationTest.shouldThrowErrorAfterSourceTopicDeleted (#20187)
CI / build (push) Waiting to run Details
Temporarily fix it by disable the new protocol, will take a deeper look
at it in the consumer protocol.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2025-07-18 21:51:45 +02:00
Chang-Chi Hsu 5ac0266879
MINOR: Declare inner RocksDBDualCFIterator class as static (#20182)
Reviewers: Lan Ding <isDing_L@163.com>, Ken Huang <s7133700@gmail.com>,
 Chia-Ping Tsai <chia7712@gmail.com>
2025-07-17 20:54:34 +08:00
Matthias J. Sax ffcfc974d9
KAFKA-19842: Fix flaky KafkaStreamsTelemetryIntegrationTest (#20147)
The new "streams" protocol behaves slightly different to the "classic"
protocol, and thus we need to update the test to avoid race conditions.
In particular, the first call to `poll()` won't "block" and return after
task assignment completed if we need to create internal topics,  but
returns early without a task assignment, and only a consecutive
rebalance will assign tasks.

This implies, that KafkaStreams transits to RUNNING state even if the
group is still in NOT_READY state broker side, but this NOT_READY  state
is not reflected in the client side state machine.

Disabling the combination of "complex-topology + streams" for now,
until this difference in behavior of the client state machine is fixed.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-07-14 17:13:54 -07:00
Jinhe Zhang c625b44d8c
MINOR: Throw exceptions if source topic is missing (#20123)
CI / build (push) Waiting to run Details
In the old protocol, Kafka Streams used to throw a
`MissingSourceTopicException` when a source topic is missing. In the new
protocol, it doesn’t do that anymore, while only log the status that is
returned from the broker, which contains a status that indicates that a
source topic is missing.

This change:
1. Throws an `MissingSourceTopicException` when source topic is missing
2. Adds unit tests
3. Modifies integration tests to fit both old and new protocols

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2025-07-09 21:19:12 +02:00
Mickael Maison a3ed705092
MINOR: Fix build warning in Streams (#20098)
CI / build (push) Waiting to run Details
When building Streams I get this warning:
```
> Task :streams:compileTestJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note:
<PATH>/kafka/streams/src/test/java/org/apache/kafka/streams/processor/internals/RecordCollectorTest.java
uses unchecked or unsafe operations.
```

Reviewers: Jhen-Yung Hsu <jhenyunghsu@gmail.com>, Ken Huang
 <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-07-08 02:44:12 +08:00