Commit Graph

3228 Commits

Author SHA1 Message Date
Andrew Schofield 3d9f88daf3
KAFKA-17546 Admin.listGroups and kafka-groups.sh (#17626)
This implements the kafka-groups.sh tool and Admin.listGroups method defined in KIP-1043.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-02 05:37:04 +08:00
PoAn Yang 5a3b544d61
KAFKA-17880 Move integration test from streams module to streams/integration-tests module (#17615)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-01 18:21:06 +08:00
Ken Huang 2a46282b2a
KAFKA-17873: Add description to all packages in the public API (#17605)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2024-10-30 15:41:10 +01:00
Nick Telford 571f50817c
KAFKA-17411: Create local state Standbys on start (#16922)
Instead of waiting until Tasks are assigned to us, we pre-emptively
create a StandbyTask for each non-empty Task directory found on-disk.

We do this before starting any StreamThreads, and on our first
assignment (after joining the consumer group), we recycle any of these
StandbyTasks that were assigned to us, either as an Active or a
Standby.

We can't just use these "initial Standbys" as-is, because they were
constructed outside the context of a StreamThread, so we first have to
update them with the context (log context, ChangelogReader, and source
topics) of the thread that it has been assigned to.

The motivation for this is to (in a later commit) read StateStore
offsets for unowned Tasks from the StateStore itself, rather than the
.checkpoint file, which we plan to deprecate and remove.

There are a few additional benefits:

Initializing these Tasks on start-up, instead of on-assignment, will
reduce the time between a member joining the consumer group and beginning
processing. This is especially important when active tasks are being moved
over, for example, as part of a rolling restart.

If a Task has corrupt data on-disk, it will be discovered on startup and
wiped under EOS. This is preferable to wiping the state after being
assigned the Task, because another instance may have non-corrupt data and
would not need to restore (as much).

There is a potential performance impact: we open all on-disk Task
StateStores, and keep them all open until we have our first assignment.
This could require large amounts of memory, in particular when there are
a large number of local state stores on-disk.

However, since old local state for Tasks we don't own is automatically
cleaned up after a period of time, in practice, we will almost always
only be dealing with the state that was last assigned to the local
instance.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Bruno Cadonna <cadonna@apache.org>, Matthias Sax <mjsax@apache.org>
2024-10-29 12:59:25 -07:00
Alieh Saeedi 4817eb9227
KAFKA-15344: Streams task should cache consumer nextOffsets (#17091)
This PR augments Streams messages with leader epoch. In case of empty buffer queues, the last offset and leader epoch are retrieved from the streams task 's cache of nextOffsets.

Co-authored-by: Lucas Brutschy <lbrutschy@confluent.io>
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-10-29 09:30:11 +01:00
Yung fc4b739578
KAFKA-17854 Improve tests for ReadOnlyWindowStoreStub#fetch and #backwardFetch (#17586)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-25 02:35:07 +08:00
Sanskar Jhajharia 8faeb9390d
MINOR: Code cleanup Kafka Streams (#16050)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-10-23 16:54:06 -07:00
Alieh Saeedi 14a098b289
KAFKA-17600: Add nextOffsets to the ConsumerRecords (#17414)
This PR implements KIP-1094.

Reviewers: Andrew Schofield <aschofield@confluent.io>, Kirk True <ktrue@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2024-10-23 16:25:50 +02:00
Dmitry Werner 1c405875fa
MINOR: Fix duplicate condition in ReadOnlyWindowStoreStub (#17540)
Reviewers: Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-10-23 02:23:14 +08:00
Matthias J. Sax f30f2d03e9
KAFKa-16331: remove EOSv1 support for getting clientInstanceIds (#17521)
With EOSv1 removed, we don't need to collect producer's clientInstanceIds per task any longer. While we never completed this feature, we can remove the corresponding scaffolding code.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-10-21 18:24:46 -07:00
Loïc GREFFIER d6b5943570
KAFKA-17099: Print the origin processor node in logs when a processing exception occurs (#17475)
This PR leverages the updates brought by KIP-1033 to get the name of the processor node which raised a processing exception and display it in the stacktrace instead of the source node.

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-10-18 11:31:09 +02:00
Zhengke Zhou 6d39031958
KAFKA-17558: Remove parameterization from streams integration tests (#17315)
Integration tests should run with either at-least-once or exactly-once.
There is no need to run them twice.
This PR removes the corresponding test parameters and picks either one of both.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-10-17 13:54:30 -07:00
A. Sophie Blee-Goldman 1de4f27ec0
KAFKA-17805: Deprecate named topologies in Kafka Streams (#17513)
Deprecate for 4.0. This feature will be phased out, with new functionality generally not supporting named topologies, so users are encouraged to migrate off of named topologies as soon as possible.

Though who are using this experimental feature are encouraged to reach out by filing a jira ticket so we can better understand your use case and how to support it going forward.

Reviewers: Matthias Sax <mjsax@apache.org>
2024-10-16 14:24:30 -07:00
Bill Bejeck 493e4c1cc9
KAFKA-17248: Override admin client to push metrics true, test for case where streams metrics [4/N] (#17422)
This PR disables metrics push for the AdminClient as the default. KafkaStreams enables metrics push for its internal AdminClient.

Tests are included that assert an error if a user disables either the main consumer or admin client metrics push but Kafka Streams metrics push config is enabled.

Reviewers: Matthias Sax <mjsax@apache.org>
2024-10-16 15:01:50 -04:00
Bruno Cadonna 3b619db404
MINOR: Fix flakiness in state updater unit tests (#16562)
Unit test shouldRestoreSingleActiveStatefulTask() in DefaultStateUpdaterTest is flaky.

The flakiness comes from the fact that the state updater thread could call the first time changelogReader.allChangelogsCompleted() before it calls the first time changelogReader.completedChangelogs(). That happens, if runOnce() is run before the state updater thread reads a task from the input queue.

This commit fixes the flakiness, by making stubbing changelogReader.allChangelogsCompleted() depend on stubbing changelogReader.completedChangelogs().

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-10-16 14:37:50 +02:00
Gaurav Narula b03fe66cfe
KAFKA-17759 Remove Utils.mkSet (#17460)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-11 21:20:43 +08:00
Matthias J. Sax 8d186bfb4f
KAFKA-16331: Remove task producers from Kafka Streams (#17344)
With EOSv1 removal, we don't have producer-per-task any longer,
and thus can remove the corresponding code which handles task producers.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bill Bejeck <bill@confluent.io>
2024-10-08 15:36:05 -07:00
Mickael Maison 3815339e05
KAFKA-14158: Remove auto.include.jmx.reporter configuration (#17360)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-08 16:17:07 +02:00
Matthias J. Sax ccdf176d05
KAFKA-16331: Remove KafkaClientSupplier from unit tests (#17330)
We don't pass in a client-supplier into `StreamsProducer` any longer,
so we can simplify `StreamsProducerTest` and remove client-supplier.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-10-07 14:10:16 -07:00
Bill Bejeck dbc0e9af70
KAFKA-17248: Add reporter for getting client metrics into telemetry pipeline and test [3/N] (#17377)
This PR adds a Reporter instance that will add streams client metrics to the telemetry pipeline.
For testing, the PR adds a unit test.

Reviewers: Matthias Sax <mjsax@apache.org>
2024-10-07 16:21:36 -04:00
Mickael Maison b4dd434f5e
KAFKA-17692 Remove KafkaServer references from IntegrationTestUtils (#17372)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-07 03:27:33 +08:00
Bill Bejeck 930f165546
KAFKA-17248: Add reporter for adding thread metrics to telemetry pipeline and a test [2/N] (#17376)
This PR adds a Reporter instance that will add streams thread metrics to the telemetry pipeline.
For testing, the PR adds a unit test.

Reviewers: Matthias Sax <mjsax@apache.org>
2024-10-05 18:28:31 -04:00
Bill Bejeck c11a38f9df
KAFKA-17248: KIP-1076 add admin client test helper [1/N] (#17375)
No functional changes, this PR contains a test-helper class for working with AdminClient

Reviewers Matthias Sax <mjsax@apache.org>
2024-10-04 13:58:16 -04:00
Chia-Ping Tsai 979740b49d
KAFKA-17589 Move JUnit extensions to test-common module (#17318)
This patch completely removes the compile-time dependency on core for both test and main sources by introducing two new modules.

1) `test-common` include all the common test implementation code (including dependency on :core for BrokerServer, ControllerServer, etc)
2) `test-common:api` new sub-module that just includes interfaces including our junit extension

Reviewers: David Arthur <mumrah@gmail.com>
2024-10-03 10:28:37 +08:00
Matthias J. Sax 22a14d75c2
MINOR: improve KafkaStreams.State JavaDocs (#17351)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-03 10:23:50 +08:00
David Arthur be1929c44c
KAFKA-17680 Add timeout to streams test teardown (#17346)
When calling KafkaStreams#close from teardown methods in integration tests, we need to pass timeout to avoid potentially blocking forever during teardown.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-10-02 16:36:21 -04:00
Matthias J. Sax 4312ce6d25
MINOR: improve RecordCollectorImpl (#17185)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-10-01 12:33:42 -07:00
陳昱霖(Yu-Lin Chen) 4c90d3518b
KAFKA-17646 Fix flaky KafkaStreamsTest.testStateGlobalThreadClose (#17310)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-02 02:18:13 +08:00
Alieh Saeedi bb112570ae
KAFKA-17109: Move lock backoff retry to streams TaskManager (#17209)
This PR implements exponential backoff for failed initializations of tasks due to lock exceptions. It increases the time between two consecutive attempts of initializing the tasks.

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-09-30 13:30:54 +02:00
Arnav Dadarya 05696037d3
KAFKA-12823 Remove Deprecated method KStream#through (#16761)
Implements KIP-1087

Reviewers: Matthias J. Sax <matthias@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-09-28 15:21:26 -07:00
Omnia Ibrahim 1854d4b8a1
KAFKA-14572: Migrate EmbeddedKafkaCluster used by Streams integration tests from EmbeddedZookeeper to KRaft (#17016)
Migrate the EmbeddedKafkaCluster from the EmbeddedZookeeper to KRaft

Reviewers Bill Bejeck <bbejeck@apache.org>
2024-09-27 15:49:12 -04:00
Matthias J. Sax ce5491b7bf
KAFKA-16331: remove KafkaClientSupplier from StreamsProducer (#17259)
With EOSv1 removed, we don't need to create a producer per task, and thus can simplify the code by removing KafkaClientSupplier from the deeply nested StreamsProducer, to simplify the code.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-09-26 17:07:00 -07:00
Joao Pedro Fonseca Dantas 27a3c75216
KAFKA-17488: Cleanup (test) code for Kafka Streams "metric version" (#17182)
This PR simply StreamsMetricsImpl to avoid passing in the unused "metric version" parameter.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-09-26 17:04:01 -07:00
Matthias J. Sax 6b9ea76456
KAFKA-17057: Add RETRY option to ProductionExceptionHanlder (#17163)
Implements KIP-1065

Reviewers: Alieh Saeedi <asaeedi@confluent.io>, Bill Bejeck <bill@confluent.io>
2024-09-25 20:06:16 -07:00
Matthias J. Sax 2e8bae8c7e
MINOR: Fix SubscriptionResponseWrapperSerializer (#17205)
The existing check is not correct, because `byte` range is from -128...127.
This PR fixes the check to use `< 0`.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-23 19:32:30 -07:00
Matthias J. Sax d063443825
MINOR: fixing JavaDocs and other cleanup (#17207)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-23 11:46:40 +08:00
Matthias J. Sax 9685aa7547
KAFKA-16331 remove EOSv1 from StreamsProducer (#17212)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-23 11:34:39 +08:00
Matthias J. Sax bf450ebe5a
MINOR: fix generics in streams-test-utils package (#17206)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-21 22:48:38 +08:00
Matthias J. Sax 2489cf586f
KAFKA-16331: remove EOSv1 config from StreamsConfig (#17170)
Reviewers: Bill Bejeck <bill@confluent.io>
2024-09-20 15:55:03 -07:00
David Arthur 31d395163e
KAFKA-17553 Fix shutdown race condition in StreamThreadTest (#17191)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-19 15:17:25 +08:00
陳昱霖(Yu-Lin Chen) 8f5cf9968f
KAFKA-17515 Fix flaky RestoreIntegrationTest.shouldInvokeUserDefinedGlobalStateRestoreListener (#17187)
Found two issues in the flaky tests: (Put the log analysis under Jira comments.)

1) The error "java.nio.file.DirectoryNotEmptyException" occurs if the flush() of kafkaStreams.close() and purgeLocalStreamsState() are triggered in the same time. (The current timeout is 5 sec, which is too short since the CI is unstable and slow).
2) Racing issue: Task to-be restored in ks-1 are rebalanced to ks-2 before entering active restoring state. So no onRestoreSuspend() was triggered.

To solve the issues:
1) Remove the timeout in kafkaStreams.close()
2) Ensure all tasks in ks-1 are active restoring before start second KafkaStreams(ks-2)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-19 14:58:04 +08:00
Matthias J. Sax aaf3fc05f8
MINOR: fix rawtype warning in StandbyTask (#17203)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-16 11:49:19 -07:00
Matthias J. Sax 21e67b3d21
KAFKA-16331 Remove EOSv1 from Kafka Streams integration tests (#17110)
Reviewers: Bill Bejeck <bbejeck@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-09-17 00:27:51 +08:00
Matthias J. Sax 6610a4d46f
KAFKA-17527: Fix NPE for null RecordContext (#17169)
Reviewers: Bruno Cadonna <bruno@confluent.io>
2024-09-13 16:34:15 -07:00
Bruno Cadonna 0035ac06d3
KAFKA-17489: Do not handle failed tasks as tasks to assign (#17115)
Failed tasks discovered when removed from the state updater during assignment or revocation are added to the task registry. From there they are retrieved and handled as normal tasks. This leads to a couple of IllegalStateExceptions because it breaks some invariants that ensure that only good tasks are assigned and processed.

This commit solves this bug by distinguish failed from non-failed tasks in the task registry.

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-09-13 10:41:45 +02:00
Matthias J. Sax b436499557
KAFKA-17524: Add timeout to StreamThreadTest (#17180)
Adds a 30s default timeout to StreamThreadTest tests.

Reviewers: David Arthur <mumrah@gmail.com>
2024-09-12 15:17:25 -04:00
Ken Huang 4121a8952a
KAFKA-17427: Deprecate leaking *_DOC variables in StreamsConfig (#17171)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-09-12 10:26:00 -07:00
TengYao Chi 9b53b525e8
KAFKA-17253: Deprecate Leaking Getter Methods in Joined Helper Class (#17164)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-09-12 10:13:22 -07:00
JohnHuang c62c3899aa
KAFKA-12829: Remove deprecated StreamsBuilder#addGlobalStore of old Processor API (#17059)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2024-09-11 14:22:08 -07:00
João Pedro Fonseca Dantas 30a988a768
KAFKA-8666: Improve Documentation on usage of Materialized config object (#17145)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-09-11 14:15:34 -07:00
Kuan-Po Tseng e0ee73e98b
KAFKA-16332 Remove Deprecated builder methods for Time/Session/Join/SlidingWindows (#17126)
Removed deprecated methods:
 - TimeWindows#of
 - TimeWindows#grace
 - SessionWindows#with
 - SessionWindows#grace
 - SlidingWindows#withTimeDifferencAndGrace

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-09-11 14:12:56 -07:00
Alieh Saeedi d04f534892
KAFKA-17109: implement exponential backoff for state directory lock (#17116)
This PR implements exponential backoff for state directory lock to increase the time between two consecutive attempts of acquiring the lock.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-09-11 13:26:19 +02:00
Ken Huang 51d296c86f
MINOR: Improve JavaDocs for deprecates ForeachProcessor (#17156)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2024-09-10 18:47:55 -07:00
Matthias J. Sax 6fd973b4a5
KAFKA-16331: Remove EOSv1 from Kafka Streams system tests (#17108)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bill Bejeck <bill@confluent.io>
2024-09-10 17:55:03 -07:00
Kuan-Po Tseng 05955bc1fc
KAFKA-17224 Make ForeachProcessor internal (#17129)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-10 22:54:42 +08:00
xijiu 64b909b598
KAFKA-13588 We should consolidate `changelogFor` methods to simplify the generation of internal topic names (#17125)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-09 01:48:24 +08:00
Murali Basani 72e16cb9e1
KAFKA-16863 : Deprecate default exception handlers (#17005)
Implements KIP-1056:
 - deprecates default.deserialization.exception.handler in favor of deserialization.exception.handler
 - deprecates default.production.exception.handler in favor of production.exception.handler

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-09-07 20:14:46 -07:00
Ayoub Omari be3ab8bdd5
KAFKA-14460: Skip removed entries from in-memory KeyValueIterator (#16505)
As described in KAFKA-14460, one of the functional requirements of KeyValueStore is that "The returned iterator must not return null values" on methods which return iterator.

This is not completely the case today for InMemoryKeyValueStore. To iterate over the store, we copy the keySet in order not to block access for other threads. However, entries that are removed from the store after initializing the iterator will be returned with null values by the iterator.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-09-07 17:06:55 -07:00
Bill Bejeck 981133d350
KAFKA-17486: Flaky test RestoreIntegrationTest.shouldInvokeUserDefinedGlobalStateRestoreListener (#17104)
This test has a tricky race condition. We want the restoration to go slow enough so that when a second Kafka Streams instance starts, the restoration of a given TopicPartition pauses due to task re-assignment. But after that point, we'd like the test to proceed faster to avoid any timeout assertions. To that end, here are the changes in this PR:

Increase the restore pause to 2 seconds; this should slow the restoration enough so that the process is still in progress once the second instance starts. But once tasks are re-assigned and onRestorePause is called, the restore pause is decremented to zero, allowing the test to proceed faster.
Increase the restore batch to its original value of 5 - otherwise, the test moved too slowly.
Decrease the number of test records produced to the original value of 100. By increasing the time of restoring each batch until Kafka Streams calls onRestorePause and removing the intentional restoration slowness, 100 records proved good enough in local testing.

Reviewers: Matthias J. Sax <mjsax@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>,
   Yu-LinChen <kh87313@gmail.com>
2024-09-07 18:47:02 -04:00
Sebastien Viale b4f47aeff5
KAFKA-16448: Add timestamp to error handler context (#17054)
Part of KIP-1033.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-09-05 08:42:52 -07:00
Bill Bejeck 661825ad28
KAFKA-16993: Flaky test shouldInvokeUserDefinedGlobalStateRestoreListener (#16970)
Increased the number of records while decreasing the restore batch size to ensure the restoration does not complete before the second Kafka Streams instance starts up.

Reviewers: Matthias J. Sax <mjsax@apache.org>
2024-09-04 08:50:27 -04:00
Matthias J. Sax 32f03a06be
KAFKA-17474 fix state transition in GlobalStreamThread (#17078)
KAFKA-17100 changed the behavior of GlobalStreamThread introducing a race condition for state changes, that was exposed by failing (flaky) tests in GlobalStreamThreadTest.

This PR moves the state transition to fix the race condition.

Reviewers: Bill Bejeck <bbejeck@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-09-04 14:48:51 +08:00
Omnia Ibrahim f59d829381
KAFKA-15853 Move TransactionLogConfig and TransactionStateManagerConfig getters out of KafkaConfig (#16665)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-03 18:24:12 +08:00
Matthias J. Sax b527691e0a MINOR: add missing @Override annotations 2024-09-01 11:37:59 -07:00
Matthias J. Sax 1f5aea2a86
MINOR: remove get prefix for internal DSL methods (#17050)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-01 17:14:51 +08:00
Matthias J. Sax 4189a36b41
MINOR: fix JavaDocs of Kafka Streams context classes (#17049)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-01 12:46:39 +08:00
Arnav Dadarya 4b5df1f8e9
KAFKA-12826: Remove Deprecated Class Serdes (#17023)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-31 19:42:46 -07:00
Chia Chuan Yu d44627da99
MINOR: remove get prefix for internal KeyValueStoreWrapper (#17065)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-01 10:35:08 +08:00
Matthias J. Sax fc720d33a0
MINOR: remove get prefix for internal state methods (#17053)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-31 20:02:06 +08:00
abhi-ksolves c23b6b0365
KAFKA-16327: Removed Deprecated variable StreamsConfig#TOPOLOGY_OPTIMIZATION (#16744)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-29 18:01:39 -07:00
JohnHuang b154f58ce8
KAFKA-12829: Remove deprecated Topology#addGlobalStore of old Processor API (#16791)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-29 16:52:52 -07:00
Nancy 865cdfc1cd
KAFKA- 12834 : Removed Deprecated method under MockProcessorContext (#16778)
Reviewers: Josep Prat <josep.prat@aiven.io>, Matthias J. Sax <matthias@confluent.io>
2024-08-29 16:38:52 -07:00
xijiu 291523e3e4
KAFKA-12829: Remove the deprecated method `init(ProcessorContext, StateStore)` from the `StateStore` interface (#16906)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2024-08-28 17:49:16 -07:00
Matthias J. Sax f61719f962
MINOR: remove get prefix for internal PAPI methods (#17025)
Reviewers: Bill Bejeck <bill@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-28 09:41:32 -07:00
Nick Telford f9615ed275
KAFKA-17432: Fix threads alive after shutdown (#17018)
We currently use a `CountDownLatch` to signal when a thread has
completed shutdown to the blocking `shutdown` method. However, this
latch triggers _before_ the thread has fully exited.

Dependent on the OS thread scheduling, it's possible that this thread
will still be "alive" after the latch has unblocked the `shutdown`
method.

In practice, this is mostly a problem for `StreamThreadTest`, which now
checks that there are no `TaskExecutor` or `StateUpdater` threads
immediately after shutting them down.

Sometimes, after shutdown returns, we find that these threads are still
"alive", usually completing execution of the "thread shutdown" log
message, or even the `Thread#exit` JVM method that's invoked to clean up
threads just before they exit. This causes sporadic test failures, even
though these threads did indeed shutdown correctly.

Instead of using a `CountDownLatch`, let's just await the thread to exit
directly, using `Thread#join`. Just as before, we set a timeout, and if
the Thread is still alive after the timeout, we throw a
`StreamsException`, maintaining the contract of the `shutdown` method.

There should be no measurable impact on production code here. This will
mostly just improve the reliability of tests that require these threads
have fully exited after calling `shutdown`.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>, Bruno Cadonna <cadonna@apache.org>
2024-08-28 16:05:10 +02:00
Matthias J. Sax f69b465414
MINOR: Keep Kafka Streams configs ordered in code and docs (#16816)
Reviewers: Bill Bejeck <bill@confluent.io>
2024-08-27 18:03:24 -07:00
Murali Basani bf914b6982
KAFKA-16330: Remove deprecated methods of TaskId and make deprecated members private (#16985)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2024-08-26 14:05:43 -07:00
Caio Guedes e8b27b6a33
KAFKA-16335: Remove deprecated method of StreamPartitioner (#15482)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-26 13:16:43 -07:00
xijiu a39037e55c
KAFKA-17399 Apply LambdaValidator to code base (#16980)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-26 21:53:49 +08:00
TengYao Chi 4886414aa0
KAFKA-17324: Set config group.protocol to classic in Streams (#16878)
Streams is not compatible with the new consumer rebalance protocol proposed in KIP-848. Thus, Streams should set/override config group.protocol to classic at startup to ensure that the classic protocol is used.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-08-26 14:01:56 +02:00
Matthias J. Sax 4ae0ab38dd
MINOR: remove get prefix for internal IQ methods (#16954)
Reviewers: Bill Bejeck <bill@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-26 07:02:49 +08:00
Ramin Gharib 9eb7e1a23d
KAFKA-17100: GlobalStreamThread#start should not busy-wait (#16914)
This PR replaces a busy-wait sleep with a CountDownLatch.

Reviewers: Greg Harris <greg.harris@aiven.io>, Matthias J. Sax <matthias@confluent.io>
2024-08-25 14:53:16 -07:00
TengYao Chi 3d436f52bf
KAFKA-12824 Delete unused doBranch method (#16981)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-25 14:24:54 +08:00
Ao Li a85f0a89c8
KAFKA-17112: Manually stop task manager if stream thread is not in CREATED state (#16625)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 20:37:25 -07:00
Murali Basani 8ceb05d203
KAFKA-16329: Remove deprecated IQ metadata classes in Kafka Streams (#16762)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 20:18:30 -07:00
Ayoub Omari 38eed50e9a
MINOR: Kafka Streams JavaDoc fixes (#15694)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 19:15:17 -07:00
TengYao Chi 46597638ee
KAFKA-17371: Fix DefaultTaskExecutorTest.shouldUnassignTaskWhenRequired (#16941)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 18:44:58 -07:00
Murali Basani a2f89f5412
KAFKA-16333: remove deprecated join method with named param (#16764)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 13:20:56 -07:00
Matthias J. Sax 0300025097
MINOR: fix HTML for topology.optimization config (#16953)
The HTML rendering broke via https://issues.apache.org/jira/browse/KAFKA-14209 in 3.4 release. The currently shown value is some garbage org.apache.kafka.streams.StreamsConfig$$Lambda$20/0x0000000800c0cf18@b1bc7ed

cf https://kafka.apache.org/documentation/#streamsconfigs_topology.optimization

Verified the fix via running StreamsConfig#main() locally.

Reviewers: Bill Bejeck <bill@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-22 15:24:16 +08:00
Matthias J. Sax 1e14b0c964
MINOR: Cleanup Joined class (#14551)
Code cleanup and JavaDocs fixed, plus add missing getters to JoinedInternal.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-08-21 14:31:22 -07:00
Matthias J. Sax e4cc5d18f4
MINOR: remove get prefix for internal Kafka Streams methods (#16722)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-08-21 14:27:14 -07:00
Matthias J. Sax 9d81a67009
MINOR: update flaky KafkaStreamsTest (#16756)
testStateGlobalThreadClose() does fail sometimes, with unclear root
cause. This PR is an attempt to fix it, by cleaning up and improving the
test code across the board.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-08-21 14:23:27 -07:00
TengYao Chi c3d552d273
KAFKA-12824 Remove Deprecated method KStream#branch (#16803)
The method branch in both Java and Scala KStream class was deprecated in version 2.8:

1) org.apache.kafka.streams.scala.kstream.KStream#branch
2) org.apache.kafka.streams.kstream.KStream#branch(org.apache.kafka.streams.kstream.Predicate<? super K,? super V>...)
3) org.apache.kafka.streams.kstream.KStream#branch(org.apache.kafka.streams.kstream.Named, org.apache.kafka.streams.kstream.Predicate<? super K,? super V>...)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 09:05:13 +08:00
Andrew Schofield 7031855570
KAFKA-17318 ConsumerRecord.deliveryCount and remove deprecations (#16872)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-16 00:11:08 +08:00
PoAn Yang 97cdaaa15f
KAFKA-17312 Fix tests shouldForwardAllDbOptionsCalls and shouldOverwriteAllOptionsMethods in RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapterTest (#16857)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-12 07:02:35 +08:00
TengYao Chi 6f18f6f335
KAFKA-16328 Remove Deprecated config from StreamsConfig (#16805)
- StreamsConfig#RETRIES_CONFIG was deprecated in AK 2.7 and is no longer in use.
- StreamsConfig#DEFAULT_WINDOWED_KEY_SERDE_INNER_CLASS and
- StreamsConfig#DEFAULT_WINDOWED_VALUE_SERDE_INNER_CLASS were deprecated in AK 3.0.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-10 00:16:52 +08:00
PoAn Yang 242114eab9
KAFKA-12830: Remove Deprecated constructor in TimeWindowedDeserializer and TimeWindowedSerde (#16809)
Signed-off-by: PoAn Yang <payang@apache.org>

Reviewers: Josep Prat <josep.prat@aiven.io>
2024-08-09 11:57:44 +02:00
Ken Huang 1ff7cf3d36
KAFKA-12832 remove deprecated methods in RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter (#16813)
Reviewers: Josep Prat <josep.prat@aiven.io>
2024-08-09 11:49:28 +02:00
abhi-ksolves 6b5d172dcf
KAFKA-12828: Removed Deprecated methods under KeyQueryMetadata (#16747)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-06 18:21:23 -07:00
Bill Bejeck 4c9795eddf
MINOR: Flaky RestoreIntegrationTest (#16721)
Increase some timeouts to work against race condition.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-06 10:05:10 -07:00
Matthias J. Sax 7c539f9029
KAFKA-16448: Unify error-callback exception handling (#16745)
Follow up code cleanup for KIP-1033.

This PR unifies the handling of both error cases for exception handlers:
 - handler throws an exception
 - handler returns null

The unification happens for all 5 handler cases:
 - deserialzation
 - production / serialization
 - production / send
 - processing
 - punctuation

Reviewers:  Sebastien Viale <sebastien.viale@michelin.com>, Loic Greffier <loic.greffier@michelin.com>, Bill Bejeck <bill@confluent.io>
2024-08-03 12:40:51 -07:00
Matthias J. Sax 3922cadc5d
KAFKA-9738: Deprecate old Processor API (#16742)
Implements KIP-1070, which deprecates:
 - Transformer
 - TransformerSupplier
 - ValueTransformer
 - ValueTransformerSupplier
 - MockProcessorContext

Reviewers: Bill Bejeck <bill@confluent.io>
2024-08-02 12:55:53 -07:00
Matthias J. Sax ed179c8ba7
MINOR: update StreamsGraphTest (#16741)
Refactor test to move off deprecated `transform()` in favor of `process()`.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-31 22:21:16 -07:00
Sebastien Viale f1ef7a5a9f
KAFKA-16448: Handle processing exceptions in punctuate (#16300)
This PR is part of KIP-1033 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR actually catches processing exceptions from punctuate.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-07-31 15:53:47 -07:00
Loïc GREFFIER 0eb9ac2bd0
KAFKA-16448: Unify class cast exception handling for both key and value (#16736)
Part of KIP-1033. Minor code cleanup.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-07-31 13:24:15 -07:00
Matthias J. Sax 8f2679bebf
MINOR: update SuppressionDurabilityIntegrationTest (#16740)
Refactor test to move off deprecated `transform()` in favor of `process()`.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-31 11:28:09 -07:00
Matthias J. Sax 6224feee65
MINOR: update StandbyTaskCreationIntegrationTest (#16700)
Refactor test to move off deprecated `transform()` in favor of
`process()`.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-31 11:27:38 -07:00
Matthias J. Sax 08b3d9f37b
MINOR: update KStreamAggregationIntegrationTest (#16699)
Refactor test to move off deprecated `transform()` in favor of
`process()`.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-31 11:27:09 -07:00
Matthias J. Sax d6a41ac3ca
MINOR: update EosV2UpgradeIntegrationTest (#16698)
Refactor test to move off deprecated `transform()` in favor of
`process()`.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-31 11:26:25 -07:00
Matthias J. Sax 1528264f02
MINOR: update EosIntegrationTest (#16697)
Refactor test to move off deprecated `transform()` in favor of
`process()`.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-31 11:25:44 -07:00
Sebastien Viale 0dc9b9e4ee
KAFKA-16448: Handle fatal user exception during processing error (#16675)
This PR is part of KIP-1033 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR catch the exceptions thrown while handling a processing exception

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-07-30 22:58:07 -07:00
Matthias J. Sax e9d8109658
MINOR: simplify code which calles `Punctuator.punctuate()` (#16725)
Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-30 17:10:40 -07:00
PoAn Yang fd2cd046f8
KAFKA-17203 StreamThread leaking producer instances (#16730)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-31 04:23:32 +08:00
Matthias J. Sax 683b8a2bee
MINOR: update AdjustStreamThreadCountTest (#16696)
Refactor test to move off deprecated `transform()` in favor of
`process()`.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-30 12:47:51 -07:00
Chung, Ming-Yen 7c0a96d08d
KAFKA-17185 Declare Loggers as static to prevent multiple logger instances (#16680)
As discussed in #16657 (comment) , we should make logger as static to avoid creating multiple logger instances.
I use the regex private.*Logger.*LoggerFactory to search and check all the results if certain logs need to be static.

There are some exceptions that loggers don't need to be static:
1) The logger in the inner class. Since java8 doesn't support static field in the inner class.
        https://github.com/apache/kafka/blob/trunk/clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetchRequestManagerTest.java#L3676

2) Custom loggers for each instance (non-static + non-final). In this case, multiple logger instances is actually really needed.
        https://github.com/apache/kafka/blob/trunk/storage/src/test/java/org/apache/kafka/server/log/remote/storage/LocalTieredStorage.java#L166

3) The logger is initialized in constructor by LogContext. Many non-static but with final modifier loggers are in this category, that's why I use .*LoggerFactory to only check the loggers that are assigned initial value when declaration.
    
4) protected final Logger log = Logger.getLogger(getClass())
    This is for subclass can do logging with subclass name instead of superclass name.
    But in this case, if the log access modifier is private, the purpose cannot be achieved since subclass cannot access the log defined in superclass. So if access modifier is private, we can replace getClass() with <className>.class

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-31 02:37:36 +08:00
Josep Prat e299a006c8
KAFKA-17214: Add 3.8.0 version to streams system tests (#16728)
* KAFKA-17214: Add 3.8.0 version to streams system tests

Reviewers: Bill Bejeck <bbejeck@gmail.com>
2024-07-30 19:04:38 +02:00
Matthias J. Sax 3c580e25bf
MINOR: update flaky CustomHandlerIntegrationTest (#16710)
This PR reduces the MAX_BLOCK_MS config which defaults to 60sec to
10sec, to avoid a race condition with the 60sec test timeout.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-30 08:13:59 -07:00
Matthias J. Sax 3db4a78167 HOTFIX: fix compilation error 2024-07-29 21:07:49 -07:00
Sebastien Viale faaef527d7
KAFKA-16448: Add ErrorHandlerContext in deserialization exception handler (#16432)
This PR is part of KIP1033 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR expose the new ErrorHandlerContext as a parameter to the Deserialization exception handlers and deprecate the previous handle signature.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-07-29 20:33:33 -07:00
Sebastien Viale b6d5f0556c
KAFKA-16448: Add ErrorHandlerContext in production exception handler (#16433)
This PR is part of KIP-1033 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR expose the new ErrorHandlerContext as a parameter to the Production exception handler and deprecate the previous handle signature.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-07-29 20:17:15 -07:00
Colin P. McCabe 0ec520a2af Bump trunk to 4.0.0-SNAPSHOT 2024-07-29 15:51:54 -07:00
Matthias J. Sax b6c1cb0eec
MINOR: update CachingPersistentWindowStoreTest (#16701)
Refactor test to move off deprecated `transform()` in favor of
`process()`.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-07-29 12:45:13 -07:00
TengYao Chi b348b556be
KAFKA-17202 surround consumer with try-resource statement (#16702)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-30 01:06:11 +08:00
Kirk True d260b06180
KAFKA-17060 Rename LegacyKafkaConsumer to ClassicKafkaConsumer (#16683)
Reviewers: Andrew Schofield <aschofield@confluent.io>, Lianet Magrans <lianetmr@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-07-29 20:56:23 +08:00
TengYao Chi a07294a732
KAFKA-17204: KafkaStreamsCloseOptionsIntegrationTest.before leaks AdminClient (#16692)
To avoid a resource leak, we need to close the AdminClient after the test.

Reviewers: Lianet Magrans <lianetmr@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2024-07-26 10:32:39 -07:00
Sebastien Viale 09be14bb09
KAFKA-16448: Fix processing exception handler (#16663)
Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: loicgreffier <loic.greffier@michelin.com>

Minor code improvements across different classed, related to the `ProcessingExceptionHandler` implementation (KIP-1033).

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-07-25 16:17:31 -07:00
dujian0068 7efb58f321
KAFKA-16584 Make log processing summary configurable or debug (#16509)
KAFKA-16584 Make log processing summary configurable or debug

Reviewers: Matthias Sax <mjsax@apache.org>, Bill Bejeck <bbejeck@apache.org>
2024-07-23 16:09:25 -04:00
PoAn Yang defcbb51ee
KAFKA-17082 replace kafka.utils.LogCaptureAppender with org.apache.kafka.common.utils.LogCaptureAppender (#16601)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-21 18:22:05 +08:00
Loïc GREFFIER 4de83d38c9
KAFKA-16448: Catch and handle processing exceptions (#16093)
This PR is part of KAFKA-16448 (KIP-1033) which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR actually catches processing exceptions.

Authors:
@Dabz
@sebastienviale
@loicgreffier

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Bruno Cadonna <cadonna@apache.org>
2024-07-19 11:24:25 +02:00
Matthias J. Sax a9b2b36908
MINOR: Add more debug logging to EOSUncleanShutdownIntegrationTest (#16490)
Reviewers: Bruno Cadonna <bruno@confluent.io>
2024-07-14 10:28:31 -07:00
Bruno Cadonna a0309be7f4
KAFKA-17098: Re-add task to state updater if transit to RUNNING fails (#16570)
When Streams tries to transit a restored active task to RUNNING, the
first thing it does is getting the committed offsets for this task.
If getting the offsets expires a timeout, Streams does not re-throw
the error initially, but tries to get the committed offsets later
until a Streams-specific timeout is hit.

Restored active tasks from the state updater are removed from the
output queue of the restored tasks in the state updater. If a
timeout occurs, the restored task is neither added to the
task registry nor re-added to the state updater. The task is lost
since it is not maintained anywhere. This means the task is also
not closed. When the same task is created again on the same
stream thread since the stream thread does not know about this
lost task, the state stores are opened again and RocksDB will
throw the "No locks available" error.

This commit re-adds the task to the state updater if the
committed request times out.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-07-11 17:45:56 +02:00
Bruno Cadonna d7fbdcfd83
KAFKA-17085: Handle tasks in state updater before tasks in task registry (#16555) (#16561)
When a active tasks are revoked they land as suspended tasks in the
task registry. If they are then reassigned, the tasks are resumed
and put into restoration. On assignment, we first handle the tasks
in the task registry and then the tasks in the state updater. That
means that if a task is re-assigned after a revocation, we remove
the suspended task from the task registry, resume it, add it
to the state updater, and then remove it from the list of tasks
to create. After that we iterate over the tasks in the state
updater and remove from there the tasks that are not in the list
of tasks to create. However, now the state updater contains the
resumed tasks that we removed from the task registry before but
are no more in the list of tasks to create. In other words, we
remove the resumed tasks from the state updater and close them
although we just got them assigned.

This commit ensures that we first handle the tasks in the
state updater and then the tasks in the task registry.

Cherry-pick of 4ecbb75

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-07-11 10:41:55 +02:00
Bruno Cadonna 25230b5388
KAFKA-10199: Close pending active tasks to init on partitions lost (#16545) (#16550)
With enabled state updater tasks that are created but not initialized
are stored in a set. In each poll iteration the stream thread drains
that set, intializes the tasks, and adds them to the state updater.

On partition lost, all active tasks are closed.

This commit ensures that active tasks pending initialization in
the set mentioned above are closed cleanly on partition lost.

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-07-08 21:14:15 +02:00
Bill Bejeck 20e101c2e4
KAFKA-16991: Flaky PurgeRepartitionTopicIntegrationTest (#16503)
When the PurgeRepartitionTopicintegrationTest was written, the InitialTaskDelayMs was hard-coded on the broker requiring setting a timeout in the test to wait for the delay to expire. But I believe this creates a race condition where the test times out before the broker deletes the inactive segment. PR #15719 introduced an internal config to control the IntitialTaskDelayMs config for speeding up tests, and this PR leverages this internal config to reduce the task delay to 0 to eliminate this race condition.
2024-07-03 10:02:28 -04:00
abhi-ksolves 6897b06b03
KAFKA-3346 Rename Mode to ConnectionMode (#16403)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-03 02:46:04 +08:00
Alieh Saeedi 15a4501bde
KAFKA-16508: Streams custom handler should handle the timeout exceptions (#16450)
For a non-existing output topic, Kafka Streams ends up in an infinite retry loop, because the returned TimeoutException extends RetriableException.

This PR updates the error handling pass for this case and instead of retrying calls the ProductionExceptionHandler to allow breaking the infinite retry loop.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-06-30 11:52:36 -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
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
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
dujian0068 b07688b063
MINOR: Improve TaskAssignor#onAssignmentComputed() javadoc (#16434) 2024-06-25 22:28:36 +08: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
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
Ken Huang 2d692e4506
KAFKA-15623 (3/N) Migrate test of Stream module to Junit5 (Stream state) (#16356)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-21 02:17:36 +08:00
Kuan-Po (Cooper) Tseng 26b9163487
KAFKA-15623 (2/N) Migrate remaining tests in streams module to JUnit 5 (integration & internals) (#16360)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-20 09:24:44 +08:00
Rohan a0bfc64470
KAFKA-15774: use the default dsl store supplier for fkj subscriptions (#16380)
Foreign key joins have an additional "internal" state store used for subscriptions, which is not exposed for configuration via Materialized or StoreBuilder which means there is no way to plug in a different store implementation via the DSL operator. However, we should respect the configured default dsl store supplier if one is configured, to allow these stores to be customized and conform to the store type selection logic used for other DSL operator stores

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-19 00:32:59 -07: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
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
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
Antoine Pourchet 8afa5e74ac
KAFKA-15045: (KIP-924 pt. 26) default standby task assignment nit (#16331)
The new default standby task assignment in TaskAssignment should only assign standby tasks for changelogged tasks, not all stateful tasks.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-14 00:08:31 -07:00
PoAn Yang c32693d556
KAFKA-15623 (1/N) Migrate streams tests module to JUnit 5 (#16254)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-14 12:54:11 +08:00
Greg Harris dfe0fcfe28
MINOR: Change KStreamKstreamOuterJoinTest to use distinct left and right types (#15513)
KStreamKStreamJoin was recently refactored to be type safe with regard to left and right value-types. This PR updates the corresponding test to use different value types instead of the same one to improve test coverage.

Reviewers: Bruno Cadonna <bruno@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-06-13 18:32:25 -07:00
dujian0068 133f2b0f31
KAFKA-16879 SystemTime should use singleton mode (#16266)
Reviewers: Greg Harris <gharris1727@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-06-14 08:49:19 +08:00
A. Sophie Blee-Goldman 4333af5c9f
KAFKA-15045: (KIP-924 pt. 25) Rename old internal StickyTaskAssignor to LegacyStickyTaskAssignor (#16322)
To avoid confusion in 3.8/until we fully remove all the old task assignors and internal config, we should rename the old internal assignor classes like the StickyTaskAssignor so that they won't be mixed up with the new version of the assignor (which is also named StickyTaskAssignor)

Reviewers: Bruno Cadonna <cadonna@apache.org>, Josep Prat <josep.prat@aiven.io>
2024-06-13 11:27:50 -07:00
gongxuanzhang 596b945072
KAFKA-16643 Add ModifierOrder checkstyle rule (#15890)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-13 15:39:32 +08:00
Antoine Pourchet 103ff5c0f0
KAFKA-15045: (KIP-924 pt. 24) internal TaskAssignor rename to LegacyTaskAssignor (#16318)
Since the new public API for TaskAssignor shared a name, this rename will prevent users from confusing the internal definition with the public one.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-13 00:32:39 -07:00
Antoine Pourchet 16e2b68b73
KAFKA-15045: (KIP-924 pt. 23) More TaskAssignmentUtils tests (#16292)
Also moved the assignment validation test from StreamsPartitionAssignorTest to TaskAssignmentUtilsTest.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-12 14:25:47 -07:00
Bruno Cadonna 39ffdea6d3
KAFKA-10199: Enable state updater by default (#16107)
We have already enabled the state updater by default once.
However, we ran into issues that forced us to disable it again.
We think that we fixed those issues. So we want to enable the
state updater again by default.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-06-12 07:51:38 +02:00
Antoine Pourchet 0782232fbe
KAFKA-15045: (KIP-924 pt. 22) Add RackAwareOptimizationParams and other minor TaskAssignmentUtils changes (#16294)
We now provide a way to more easily customize the rack aware
optimizations that we provide by way of a configuration class called
RackAwareOptimizationParams.

We also simplified the APIs for the optimizeXYZ utility functions since
they were mutating the inputs anyway.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-11 21:31:43 -07:00
Antoine Pourchet 8b6013f851
KAFKA-15045: (KIP-924 pt. 21) UUID to ProcessId migration (#16269)
This PR changes the assignment process to use ProcessId instead of UUID.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-11 12:24:44 -07:00
Loïc GREFFIER 2533a07ad0
KAFKA-16448: Add ProcessingExceptionHandler in Streams configuration (#16188)
This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler in Streams configuration.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: sebastienviale <sebastien.viale@michelin.com>

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-06-10 13:23:10 +02:00
Antoine Pourchet 34afdb9627
KAFKA-15045: (KIP-924 pt. 20) Custom task assignment configuration fix (#16245)
The StreamsConfig class was not parsing the new task assignment
configuration flag properly, which made it impossible to properly
configure a custom task assignor.

This PR fixes this and adds a bit of INFO logging to help users diagnose
assignor misconfiguration issues.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-08 19:55:13 -07:00
Antoine Pourchet 824900b97a
KAFKA-15045: (KIP-924 pt. 18) Better assignment testing (#16201)
Added more testing for the StickyTaskAssignor, which includes a large-scale test with rack aware enabled.

Also added a no-op change to StreamsAssignmentScaleTest.java to allow for rack aware optimization testing.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-08 19:48:43 -07:00
Antoine Pourchet ee834d9214
KAFKA-15045: (KIP-924 pt. 19) Update to new AssignmentConfigs (#16219)
This PR updates all of the streams task assignment code to use the new AssignmentConfigs public class.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-06 14:20:48 -07:00
Bruno Cadonna 8a2bc3a221
KAFKA-16903: Consider produce error of different task (#16222)
A task does not know anything about a produce error thrown
by a different task. That might lead to a InvalidTxnStateException
when a task attempts to do a transactional operation on a producer
that failed due to a different task.

This commit stores the produce exception in the streams producer
on completion of a send instead of the record collector since the
record collector is on task level whereas the stream producer
is on stream thread level. Since all tasks use the same streams
producer the error should be correctly propagated across tasks
of the same stream thread.

For EOS alpha, this commit does not change anything because
each task uses its own producer. The send error is still
on task level but so is also the transaction.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-06-06 12:19:52 -07:00
Loïc GREFFIER ebe1e964ff
KAFKA-16448: Add ProcessingExceptionHandler interface and implementations (#16187)
This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler interface and default implementations.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: sebastienviale <sebastien.viale@michelin.com>

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-06-06 13:40:31 +02:00
Ayoub Omari 1134520dec
KAFKA-16573: Specify node and store where serdes are needed (#15790)
Reviewers: Matthias J. Sax <matthias@confluent.io>, Bruno Cadonna <bruno@confluent.io>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-05 15:05:04 -07:00
Antoine Pourchet 0109a3f718
KAFKA-15045: (KIP-924 pt. 17) State store computation fixed (#16194)
Fixed the calculation of the store name list based on the subtopology being accessed.

Also added a new test to make sure this new functionality works as intended.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-05 13:09:37 -07:00
Antoine Pourchet 5ce4b91dfa
KAFKA-15045: (KIP-924 pt. 16) TaskAssignor.onAssignmentComputed handling (#16147)
This PR takes care of making the call back toTaskAssignor.onAssignmentComputed.

It also contains a change to the public AssignmentConfigs API, as well as some simplifications of the StickyTaskAssignor.

This PR also changes the rack information fetching to happen lazily in the case where the TaskAssignor makes its decisions without said rack information.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-06-04 11:33:48 -07:00
Josep Prat 7e81cc5e68
MINOR: Bump trunk to 3.9.0-SNAPSHOT (#16150)
Signed-off-by: Josep Prat <josep.prat@aiven.io>

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-31 16:41:44 +02:00
Bruno Cadonna 76d1f18e42
Revert "KAFKA-16448: Add ProcessingExceptionHandler interface and implementations (#16090)" (#16142)
This reverts commit 8d11d95795.

We decided to not release KIP-1033 with AK 3.8

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-05-31 09:56:36 +02:00
Antoine Pourchet 370e5ea1f8
KAFKA-15045: (KIP-924 pt. 15) Implement #defaultStandbyTaskAssignment and finish rack-aware standby optimization (#16129)
This fills in the implementation details of the standby task assignment utility functions within TaskAssignmentUtils.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-30 15:11:33 -07:00
Bruno Cadonna fea3eeb7f7
Revert "KAFKA-16448: Add ProcessingExceptionHandler in Streams configuration (#16092)" (#16141)
This reverts commit 3f70c46874.

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-05-30 17:52:07 +02:00
Loïc GREFFIER 3f70c46874
KAFKA-16448: Add ProcessingExceptionHandler in Streams configuration (#16092)
This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler in Streams configuration.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: sebastienviale <sebastien.viale@michelin.com>

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-05-30 10:39:38 +02:00
Antoine Pourchet 5c08ee0062
KAFKA-15045: (KIP-924 pt. 9) TaskAssignmentUtils implementation of optimizeRackAwareActiveTasks (#16033)
This PR implements the rack aware optimization of active tasks that can be used by the assignors themselves. It takes in the full output of the assignment and tries to reorganize it so as to minimize cross-rack traffic.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-29 16:11:37 -07:00
Antoine Pourchet cc269b0d43
KAFKA-15045: (KIP-924 pt. 14) Callback to TaskAssignor::onAssignmentComputed (#16123)
This PR adds the logic and wiring necessary to make the callback to
TaskAssignor::onAssignmentComputed with the necessary parameters.

We also fixed some log statements in the actual assignment error
computation, as well as modified the ApplicationState::allTasks method
to return a Map instead of a Set of TaskInfos.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-29 13:15:02 -07:00
Loïc GREFFIER 8d11d95795
KAFKA-16448: Add ProcessingExceptionHandler interface and implementations (#16090)
This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler interface and default implementations.

Co-authored-by: Dabz <d.gasparina@gmail.com>
Co-authored-by: sebastienviale <sebastien.viale@michelin.com>

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-05-29 14:09:22 +02:00
Ramin Gharib b73f4798a4
KAFKA-16362: Fix type-unsafety in KStreamKStreamJoin caused by isLeftSide (#15601)
The introduced changes provide a cleaner definition of the join side in KStreamKStreamJoin. Before, this was done by using a Boolean flag, which led to returning a raw LeftOrRightValue without generic arguments because the generic type arguments depended on the boolean input.

Reviewers: Greg Harris <greg.harris@aiven.io>, Bruno Cadonna <cadonna@apache.org>
2024-05-29 13:12:54 +02:00
A. Sophie Blee-Goldman 9562143f08
HOTFIX: remove unnecessary list creation (#16117)
Removing a redundant list declaration in the new StickyTaskAssignor implementation

Reviewers: Antoine Pourchet <antoine@responsive.dev>
2024-05-28 21:35:02 -07:00
Antoine Pourchet d64e3fbb2b
KAFKA-15045: (KIP-924 pt. 13) AssignmentError calculation added (#16114)
This PR adds the post-processing of the TaskAssignment to figure out if the new assignment is valid, and return an AssignmentError otherwise.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-28 19:43:30 -07:00
Antoine Pourchet 8d243dfbd4
KAFKA-15045: (KIP-924 pt. 12) Wiring in new assignment configs and logic (#16074)
This PR creates the new public config of KIP-924 in StreamsConfig and uses it to instantiate user-created TaskAssignors. If such a TaskAssignor is found and successfully created we then use that assignor to perform the task assignment, otherwise we revert back to the pre KIP-924 world with the internal task assignors.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Almog Gavra <almog@responsive.dev>
2024-05-28 18:01:18 -07:00
Antoine Pourchet 56ee1392e8
KAFKA-15045: (KIP-924 pt. 11) Implemented StickyTaskAssignor (#16052)
This PR implements the StickyTaskAssignor with the new KIP 924 API.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-28 17:05:51 -07:00
Nick Telford 59ba555142
KAFKA-15541: Add oldest-iterator-open-since-ms metric (#16041)
Part of [KIP-989](https://cwiki.apache.org/confluence/x/9KCzDw).

This new `StateStore` metric tracks the timestamp that the oldest
surviving Iterator was created.

This timestamp should continue to climb, and closely track the current
time, as old iterators are closed and new ones created. If the timestamp
remains very low (i.e. old), that suggests an Iterator has leaked, which
should enable users to isolate the affected store.

It will report no data when there are no currently open Iterators.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-05-28 16:23:23 -07:00
Omnia Ibrahim 64f699aeea
KAFKA-15853: Move general configs out of KafkaConfig (#16040)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-28 16:22:54 +02:00
Nick Telford d9ee9c96dd
KAFKA-15541: Use LongAdder instead of AtomicInteger (#16076)
`LongAdder` performs better than `AtomicInteger` when under contention
from many threads. Since it's possible that many Interactive Query
threads could create a large number of `KeyValueIterator`s, we don't
want contention on a metric to be a performance bottleneck.

The trade-off is memory, as `LongAdder` uses more memory to space out
independent counters across different cache lines. In practice, I don't
expect this to cause too many problems, as we're only constructing 1
per-store.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-05-25 12:22:56 -07:00
Kuan-Po (Cooper) Tseng de3202832d
KAFKA-16828 RackAwareTaskAssignorTest failed (#16044)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-24 05:25:53 +08:00
Antoine Pourchet 93238ae312
KAFKA-15045: (KIP-924 pt. 10) Topic partition rack annotation simplified (#16034)
This PR uses the new TaskTopicPartition structure to simplify the build
process for the ApplicationState, which is the input to the new
TaskAssignor#assign call.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-23 12:45:29 -07:00
Nick Telford bef83ce89b
KAFKA-15541: Add iterator-duration metrics (#16028)
Part of [KIP-989](https://cwiki.apache.org/confluence/x/9KCzDw).

This new `StateStore` metric tracks the average and maximum amount of
time between creating and closing Iterators.

Iterators with very high durations can indicate to users performance
problems that should be addressed.

If a store reports no data for these metrics, despite the user opening
Iterators on the store, it suggests those iterators are not being
closed, and have therefore leaked.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-05-22 21:34:31 -07:00
Antoine Pourchet 06739d5aa0
KAFKA-15045: (KIP-924 pt. 8) Added TopicPartitionAssignmentInfo (#16024)
For task assignment purposes, the user needs to have a set of information available for each topic partition affecting the desired tasks.

This PR introduces a new interface for a read-only container class that allows all the important and relevant information to be found in one place.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-22 15:52:53 -07:00
Antoine Pourchet 27a6c156c4
KAFKA-15045: (KIP-924 pt. 7) Simplify requirements for rack aware graphs (#16004)
Rack aware graphs don't actually need any topology information about the system, but rather require a simple ordered (not sorted) grouping of tasks.

This PR changes the internal constructors and some interface signatures of RackAwareGraphConstructor and its implementations to allow reuse by future components that may not have access to the actual subtopology information.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-22 13:25:18 -07:00
Antoine Pourchet ef2c5e41a5
KAFKA-15045: (KIP-924 pt. 5) Add rack information to ApplicationState (#15972)
This rack information is required to compute rack-aware assignments, which many of the current assigners do.

The internal ClientMetadata class was also edited to pass around this rack information.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-22 13:24:26 -07:00
Nick Telford 5552f5c26d
KAFKA-15541: Add num-open-iterators metric (#15975)
Part of [KIP-989](https://cwiki.apache.org/confluence/x/9KCzDw).

This new `StateStore` metric tracks the number of `Iterator` instances
that have been created, but not yet closed (via `AutoCloseable#close()`).

This will aid users in detecting leaked iterators, which can cause major
performance problems.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-05-21 23:29:50 -07:00
Antoine Pourchet 6339e3a6bf
KAFKA-15045: (KIP-924 pt. 6) Post process new assignment structure (#16002)
This PR creates the required methods to post-process the result of TaskAssignor.assign into the required ClientMetadata map. This allows most of the internal logic to remain intact after the user's assignment code runs.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-05-21 13:14:39 -07:00
Ayoub Omari 4cc99cbf3f
KAFKA-16343: Add unit tests of foreignKeyJoin classes (#15564)
Added unit tests of two processors included in foreignKey join : SubscriptionSendProcessorSupplier and ForeignTableJoinProcessorSupplier.
Renamed ForeignTableJoinProcessorSupplierTest to SubscriptionJoinProcessorSupplierTest as that's the processor which the test class is testing.

Reviewers: Walker Carlson <wcarlson@apache.org>
2024-05-21 14:23:04 -05:00
Bruno Cadonna 69fc4c5da4
MINOR: Migrate tests in o.a.k.streams to JUnit 5 (except KafkaStreamsTest) (#15942)
Reviewers: Christo Lolov <lolovc@amazon.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-05-18 03:31:05 +08:00
Bruno Cadonna c58c21cc20
KAFKA-16774: Delete flaky test since it is redundant (#15978)
The test shouldCloseAllTaskProducersOnCloseIfEosEnabled() in
StreamThreadTest is flaky with a concurrent modification exception.
The concurrent modification exception is caused by the test itself
because it starts a stream thread and at the same time the thread
that executes the test calls methods on the stream thread. The stream
thread was not designed for such a concurrency.
The tests verifies that under EOS the streams producer are closed
during shutdown. Actually the test is not needed since we already
have a test that verifies that when the stream thread shuts down
also the task manager shuts down and for the tasks manager we have
tests that verify that the producers are closed when the task manager
shuts down.

This commit verifies that those tests are run under EOS and ALOS.

Reviewer: Matthias J. Sax <matthias@confluent.io>
2024-05-17 08:36:07 +02:00
Antoine Pourchet fafa3c76dc
KAFKA-15045: (KIP-924 pt. 4) Generify rack graph solving utilities (#15956)
The graph solving utilities are currently hardcoded to work with ClientState, but don't actually depend on anything in those state classes.

This change allows the MinTrafficGraphConstructor and BalanceSubtopologyGraphConstructor to be reused with KafkaStreamsStates instead.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Almog Gavra <almog@responsive.dev>
2024-05-16 11:37:59 -07:00
Bruno Cadonna ba19eedb90
KAFKA-7342: Migrate tests in remaining packages in o.a.k.streams (#15963)
Migrates tests in the following packages (excluding subpackages)
to JUnit 5:
- org.apache.kafka.streams.internals
- org.apache.kafka.streams.kstream
- org.apache.kafka.streams.processor
- org.apache.kafka.streams.query
- org.apache.kafka.streams.state
- org.apache.kafka.streams.tests
- org.apache.kafka.streams.utils

Reviewer: Chia-Ping Tsai <chia7712@gmail.com>
2024-05-15 20:28:34 +02:00
Bruno Cadonna d2e6c86632
KAFKA-10199: Remove queue-based remove from state updater (#15896)
Removes the unused remove operation from the state updater
that asynchronously removed tasks and put them into an
output queue.

Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
2024-05-15 09:48:33 +02:00