Commit Graph

3220 Commits

Author SHA1 Message Date
Matthias J. Sax 0bc770d7b6
MINOR: avoid WARN logs in KafkaStreams test (#18517)
Avoiding 'WARN Method #getTimestampedKeyValueStore() should be
used to access a TimestampedKeyValueStore.' running
KTableKTableForeignKeyJoinIntegrationTest.

Reviewers: Bill Bejeck <bill@confluent.io>
2025-01-15 14:08:55 -08:00
Matthias J. Sax 3f3bc90509
MINOR: Kafka Streams doc updates for 4.0 release (#18488)
Reviewers: Bill Bejeck <bill@confluent.io>
2025-01-15 11:58:53 -08:00
Matthias J. Sax 30f94b5320
KAFKA-18479: RocksDBTimeOrderedKeyValueBuffer not initialized correctly (#18490)
RocksDBTimeOrderedKeyValueBuffer is not initialize with serdes provides
via Joined, but always uses serdes from StreamsConfig.

Reviewers: Bill Bejeck <bill@confluent.io>
2025-01-15 10:04:13 -08:00
Alieh Saeedi 512e0c9628
MINOR: remove old comment in streams StateDirectory (#18546)
Reviewers: Bruno Cadonna <cadonna@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-16 01:07:55 +08:00
Matthias J. Sax 1672a4bc27
KAFKA-18476: KafkaStreams should swallow TransactionAbortedException (#18487)
TransactionAbortedException is a follow up error to a previous error,
and such a previous error would already be handled when
`producer.abortTransaction()` is called. Thus, a
TransactionAbortedException can just be silently swallowed.

Reviewers: Bill Bejeck <bill@confluent.io>
2025-01-14 18:03:14 -08:00
A. Sophie Blee-Goldman faef80a2e2
KAFKA-18026: KIP-1112, clean up StatefulProcessorNode (#18195)
Final cleanup of StatefulProcessorNode after converting all stateful operators to adding state stores via implementing the #stores method.
2025-01-14 17:42:58 -08:00
Matthias J. Sax 0e831d0840
KAFKA-8116: Update Kafka Streams archetype for Java 11 (#18471)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Bill Bejeck <bill@confluent.io>
2025-01-10 15:45:39 -08:00
Almog Gavra 2a0c31e768
MINOR: improve StreamThread periodic processing log (#18430)
The current log is really helpful, this PR adds a bit more information to that log to help debug some issues. In particular, it is interesting to be able to debug situations that have long intervals between polls. It also includes a reference to how long it has been since it last logged so you don't have to find the previous time it was logged to compute quick per-second ratios.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2025-01-09 11:01:43 -08:00
Ao Li ebe7dd2b15
KAFKA-18418: Use CDL to block the thread termination to avoid flaky tests (#18418)
This PR fixed a race-condition in KafkaStreamsTest, by replacing a non-deterministic
sleep with a CountDownLatch to fully control how long a thread blocks.

Reviewers:  David Arthur <mumrah@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2025-01-09 10:19:40 -08:00
Swikar Patel 8b72204bfd
KAFKA-15443: Upgrade RocksDB to 9.7.3 (#18275)
This PR upgrades RocksDB from 7.9.2 to 9.7.3 and addresses the following compatibility issues introduced by the RocksDB upgrade:

- Removal of AccessHint: The AccessHint class was completely removed in RocksDB 9.7.3. This required removing all import statements, variable declarations, method parameters, method return types, and static method calls related to AccessHint in RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapterTest.java Unused methods are removed in RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java
- Removal of NO_FILE_CLOSES: The NO_FILE_CLOSES metric was also removed in RocksDB 9.7.3. The calculation for numberOfOpenFiles in RocksDBMetricsRecorder.java has been adjusted to now track the total number of file opens since the last reset. The previous calculation, which subtracted NO_FILE_CLOSES from NO_FILE_OPENS, is no longer possible. The reason RocksDB removed NO_FILE_CLOSES seems to be that it did not properly work: https://github.com/search?q=repo%3Afacebook%2Frocksdb+NO_FILE_CLOSES&type=issues
- Removal of methods related to compressed block cache configuration in BlockBasedTableConfig
- Change of the signature of org.rocksdb.Options.setLogger()

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Matthias J. Sax <matthias@confluent.io>, Bruno Cadonna <cadonna@apache.org>
2025-01-09 11:55:56 +01:00
Almog Gavra 26771a6d28
KAFKA-18326: fix merge iterator with cache tombstones (#18287)
See https://issues.apache.org/jira/browse/KAFKA-18326 for more information. The main bug here is that in the old implementation, deleted cache entries would be skipped so long as they didn't equal the next store key, which resulted in potentially skipping tombstones for future keys in the store.

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2025-01-07 23:03:44 -08:00
Matthias J. Sax 738bd928f1
MINOR: cleanup JavaDocs for deprecation warnings (#18402)
Reviewers: Bill Bejeck <bbejeck@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-01-07 09:18:33 +00:00
Ismael Juma 409a43eff7
MINOR: Collection/Option usage simplification via methods introduced in Java 9 & 11 (#18305)
Relevant methods:
1. `List.of`, `Set.of`, `Map.of` and similar (introduced in Java 9)
2. Optional: `isEmpty` (introduced in Java 11), `stream` (introduced in Java 9).

Reviewers: Mickael Maison <mimaison@users.noreply.github.com>
2025-01-03 16:13:39 -08:00
Ismael Juma 73ab7ee4ea
MINOR: Use `Files.readString/writeString` and `String.repeat` to simplify code (#18372)
The 3 methods were introduced in Java 11.

Reviewers: Divij Vaidya <diviv@amazon.com>
2025-01-02 17:50:27 -08:00
A. Sophie Blee-Goldman 86b552835c
KAFKA-18026: KIP-1112, configure all StoreBuilder & StoreFactory layers (#18345)
Because of how we have to wrap StoreFactory and StoreBuilder layers on top of each other for various parts of the topology building process, we need to make sure both of these are capable of configuration and will check for & delegate to an underlying layer if it exists

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>
2024-12-31 11:45:29 -08:00
Matthias J. Sax 8c21857877
KAFKA-13722: code cleanup after deprecated StateStore.init() was removed (#18249)
We remove the deprecated overload of StateStore.init() and thus do not
need to cast any longer. This PR removes all unnecessary casts, and
additionally cleans ups all related classed to reduce warnings.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-12-20 14:31:44 -08:00
PoAn Yang 753a003480
KAFKA-18262 Remove DefaultPartitioner and UniformStickyPartitioner (#18204)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-20 15:33:51 +08:00
Matthias J. Sax f7ae4e8b71
KAFKA-12829: Remove old Processor and ProcessorSupplier interfaces (#18238)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bill Bejeck <bill@confluent.io>
2024-12-19 22:26:17 -08:00
Matthias J. Sax 9aa900f076
KAFKA-12829: Remove deprecated Topology#addProcessor of old Processor API (#18154)
Reviewers: John Huang <pegasashjy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Bill Bejeck <bill@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
2024-12-19 16:05:16 -08:00
Matthias J. Sax b3b40bb77b
KAFKA-13722: Refactor Kafka Streams store interfaces (#18243)
Refactor Segments and TimestampedSegments to not use old
ProcessorContext any longer.

Reviewers: Bruno Cadonna <bruno@confluent.io>
2024-12-19 11:55:57 -08:00
Matthias J. Sax fe9847dd4a
KAFKA-17131: Refactor TimeDefinitions (#18241)
Refactor TimeDefintiions to not use old ProcessorContext any longer.

Reviewers: Bruno Cadonna <bruno@confluent.io>
2024-12-19 11:40:43 -08:00
Bruno Cadonna a0291a8d50
MINOR: Fix flaky state updater test (#18253)
The tests are flaky because the tests end before the verified calls
are executed. This happens because the state updater thread executes
the verified calls, but the thread that executes the
tests with the verifications is a different thread.

This commit fixes the flaky tests by enusring that the calls were
performed by the state updater by either shutting down the state
updater or waiting for the condition.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-12-19 09:02:38 +01:00
Matthias J. Sax e551cb7bb3
KAFKA-13722: Refactor SerdeGetter (#18242)
Reviewers: Bruno Cadonna <cadonna@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-18 19:01:46 +08:00
Almog Gavra 4bcbf9fae7
KAFKA-18026: KIP-1112 migrate KTableSuppressProcessorSupplier (#18150)
Migrates KTableSuppressProcessorSupplier to use the the ProcessorSupplier#stores() method

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-12-17 23:45:49 -08:00
Rohan 501da383fa
KAFKA-18026: transition KTable#filter impl to use processor wrapper (#18205)
This patch transitions the KTable#filter implementation to provide the materialized store via the ProcessorSupplier so that it can be wrapped by the processor wrapper if the wrapper is configured

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-12-17 23:32:24 -08:00
Matthias J. Sax 16f1aa84df
MINOR: improve Kafka Streams config docs (#18087)
Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-12-16 15:21:52 -08:00
Matthias J. Sax 85c43e49e3
MINOR: improving some internal comments (#18152)
Reviewers: Yaroslav Kutsela (@Serwios), Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-12-16 15:21:03 -08:00
David Jacot 84049369c1
MINOR: Bump trunk to 4.1.0-SNAPSHOT (#18213)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2024-12-16 16:47:13 +01:00
A. Sophie Blee-Goldman bac8928521
KAFKA-18026: KIP-1112, migrate foreign-key joins to use ProcesserSupplier#stores (#18194)
Convert FKJ processors to implementing the #stores method

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>
2024-12-15 20:00:42 -08:00
Rohan ed10fc63a9
KAFKA-18026: supply stores for KTable#mapValues using ProcessorSupplier#stores (#18155)
KAFKA-18026: supply stores for KTable#mapValues using ProcessorSupplier#stores

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-12-14 20:18:49 -08:00
A. Sophie Blee-Goldman 91575892d2
HOTFIX: RocksDBMetricsRecorder#init should null check taskId (#18151)
Appears to be a typo in the code, since the error message indicates this check is for taskId being null, but instead we accidentally check the streams metrics twice

Reviewers: Matthias Sax <mjsax@apache.org>, runo Cadonna <cadonna@apache.org>, Lucas Brutschy <lbrutschy@confluent.io>, Bill Bejeck <bbejeck@gmail.com>
2024-12-13 20:36:08 -08:00
Lianet Magrans 84bc0c26ee
KAFKA-18224: Explicit group protocol setting in streams resetter (#18172)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-12-13 14:31:50 -05:00
TengYao Chi b37b89c668
KAFKA-9366 Upgrade log4j to log4j2 (#17373)
This pull request replaces Log4j with Log4j2 across the entire project, including dependencies, configurations, and code. The notable changes are listed below:

1. Introduce Log4j2 Instead of Log4j
2. Change Configuration File Format from Properties to YAML
3. Adds warnings to notify users if they are still using Log4j properties, encouraging them to transition to Log4j2 configurations

Co-authored-by: Lee Dongjin <dongjin@apache.org>

Reviewers: Luke Chen <showuon@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-12-14 01:14:31 +08:00
A. Sophie Blee-Goldman ef2e4600f3
KAFKA-18026: KIP-1112, migrate stream-stream joins to use ProcesserSupplier#stores (#18111)
Covers wrapping of processors and state stores for KStream-KStream joins.

Includes self-joins and the spurious results fix optimization

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>
2024-12-12 14:54:58 -08:00
Almog Gavra 9b776ffc50
KAFKA-18026: KIP-1112 convert StreamToTableNode (#18149)
Covers wrapping of processors and state stores for StreamToTableSource

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-12-12 14:52:21 -08:00
Lianet Magrans 7a64623e40
Set protocol for streams tests (#18160)
Reviewers: Bill Bejeck <bill@confluent.io>
2024-12-12 13:33:43 -05:00
Matthias J. Sax a0a501952b
MINOR: improve Kafka Streams metrics documentation (#17900)
Reviewers: Bruno Cadonna <bruno@confluent.io>, Guozhang Wang <guozhang.wang.us@gmail.com>
2024-12-11 18:34:43 -08:00
Almog Gavra 21563380f3
KAFKA-18026: KIP-1112, migrate table-table joins to use ProcesserSuppliers#stores (#18048)
Covers wrapping of processors and state stores for KTable-KTable joins

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Guozhang Wang <guozhang.wang.us@gmail.com>
2024-12-11 17:37:34 -08:00
Matthias J. Sax 6cdb8c352a
KAFKA-18015: add byDuration auto.offset.reset to Kafka Streams (#18115)
Part of KIP-1106.

Adds support for "by_duration" and "none" reset strategy
to the Kafka Streams runtime.

Reviewers: Bill Bejeck <bill@confluent.io>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-12-11 15:12:16 -08:00
Matthias J. Sax 990c8c750c
MINOR: remove old procesor API MockInternalProcessorContext (#18103)
Reviewers: Bill Bejeck <bill@confluent.io>
2024-12-11 15:09:13 -08:00
Matthias J. Sax ab2facca58
KAFKA-12829: Remove deprecated KStream.process() for old Processor API (#18088)
Reviewers: Bill Bejeck <bill@confluent.io>
2024-12-11 14:28:47 -08:00
KApolinario1120 d83f09d014
KAFKA-18015: Add support for duration based offset reset strategy to Kafka Streams (#17973)
Part of KIP-1106.

Adds the public APIs to Kafka Streams, to support the the newly added "by_duration" reset policy,
plus adds the missing "none" reset policy. Deprecates the enum `Topology.AutoOffsetReset` and
all related methods, and replaced them with new overload using the new `AutoOffsetReset` class.

Co-authored-by: Matthias J. Sax <matthias@confluent.io>

Reviewers: Matthias J. Sax <matthias@confluent.io>, Bill Bejeck <bill@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>
2024-12-11 10:47:25 -08:00
mingdaoy 4603f7495e
KAFKA-18030 Remove old upgrade-system-tests modules (#17843)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-10 11:19:14 +08:00
TengYao Chi e8837465a5
KAFKA-18067: Kafka Streams can leak Producer client under EOS (#17931)
To avoid leaking producers, we should add a 'closedflag toStreamProducer` indicating whether we should reset prouder.

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-12-09 16:12:05 -08:00
Joao Pedro Fonseca Dantas d5c2029434
KAFKA-16339: [4/4 KStream#flatTransformValues] Remove Deprecated "transformer" methods and classes (#17882)
Reviewer: Matthias J. Sax <matthias@confluent.io>
2024-12-08 20:10:11 -08:00
yx9o 38e727fe4d
KAFKA-17864: add descriptions to fields in the agreement (#17681)
Improve descriptive information in Kafka protocol documentation.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Andrew Schofield <aschofield@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>
2024-12-07 18:47:11 +00:00
Andrew Schofield e7d986e48c
KAFKA-17550: DescribeGroups v6 exploitation (#17706)
This PR introduces the DescribeGroups v6 API as part of KIP-1043. This adds an error message for the described groups so that it is possible to get some context on the error. It also changes the behaviour for when the group ID cannot be found but returning error code GROUP_ID_NOT_FOUND rather than NONE.

Reviewers: David Jacot <djacot@confluent.io>
2024-12-05 23:12:24 -08:00
A. Sophie Blee-Goldman 09e8fa2dbe
KAFKA-18026: KIP-1112, migrate stream-table joins to use ProcesserSupplier#stores (#18047)
Covers wrapping of processors and state stores for KStream-KTable joins

Reviewers: Almog Gavra <almog@responsive.dev>, Guozhang Wang <guozhang.wang.us@gmail.com>
2024-12-05 10:06:11 -08:00
Ken Huang 2b43c49f51
KAFKA-18050 Upgrade the checkstyle version to 10.20.2 (#17999)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-05 10:59:18 +08:00
A. Sophie Blee-Goldman 31d97bc3c9
KAFKA-18026: KIP-1112, skip re-registering aggregate stores in StatefulProcessorNode (#18015)
Minor followup to #17929 based on this discussion

Also includes some very minor refactoring/renaming on the side. The only real change is in the KGroupedStreamImpl class

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>
2024-12-03 22:18:55 -08:00
Peter Lee c76fb5cb9b
KAFKA-17893: Support record keys in the foreignKeyExtractor argument of KTable foreign join (#17756)
Currently, KTable foreign key joins only allow extracting the foreign key from the value of the source record. This forces users to duplicate data that might already exist in the key into the value when the foreign key needs to be derived from both the key and value. This leads to:

- Data duplication
- Additional storage overhead
- Potential data inconsistency if the duplicated data gets out of sync
- Less intuitive API when the foreign key is naturally derived from both key and value

This change allows user to extract the foreign key from the key and value of the source record.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-12-03 17:34:13 +01:00
A. Sophie Blee-Goldman 184b64fb41
KAFKA-18026: migrate KStream and KTable aggregates to use ProcesserSupplier#stores (#17929)
As part of KIP-1112, to maximize the utility of the new ProcessorWrapper, we need to migrate the DSL operators to the new method of attaching state stores by implementing ProcessorSupplier#stores, which makes these stores available for inspection by the user's wrapper.

This PR covers the aggregate operator for both KStream and KTable.


Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>, Rohan Desai <rohan@responsive.dev>
2024-12-03 02:09:43 -08:00
TengYao Chi 6fd951a9c0
KAFKA-17610 Drop alterConfigs (#18002)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-02 23:26:06 +08:00
Almog Gavra 5243fb9a7d
KAFKA-18026: migrate KTableSource to use ProcesserSupplier#stores (#17903)
This PR is part of the implementation for KIP-1112 (KAFKA-18026). In order to have DSL operators be properly wrapped by the interface suggestion in 1112, we need to make sure they all use the ConnectedStoreProvider#stores method to connect stores instead of manually calling addStateStore.

This is a refactor only, there is no new behaviors.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-11-27 14:04:27 -08:00
Bill Bejeck d334f60944
MINOR: KStreamRepartitionIntegrationTest bug (#17963)
The KStreamRepartitionIntegrationTest.shouldThrowAnExceptionWhenNumberOfPartitionsOfRepartitionOperationDoNotMatchSourceTopicWhenJoining test was taking two minutes due not reaching an expected condition. By updating to have the StreamsUncaughtExceptionHandler return a response of SHUTDOWN_CLIENT the expected ERROR state is now reached. The root cause was using the Thread.UncaughtExceptionHandler to handle the exception.

Without this fix, the test takes 2 minutes to run, and now it's 1 second.

Reviewers: Matthias Sax <mjsax@apache.org>
2024-11-27 16:08:05 -05:00
Joao Pedro Fonseca Dantas 3f834781a4
KAFKA-12844: clean up TaskId (#17904)
Rename topicGroupId as subtopology.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-11-26 17:06:36 -08:00
Matthias J. Sax f5d712396b
MINOR: fix warnings in Kafka Streams state store tests (#17855)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-27 01:54:21 +08:00
Matthias J. Sax 95947d2f58
KAFKA-17299: add unit tests for previous fix (#17919)
https://github.com/apache/kafka/pull/17899 fixed the issue, but did not
add any unit tests.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-11-25 12:03:57 -08:00
Kaushik Raina 7908a4838b
Fix long running RangeQueryIntegrationTest. (#17933)
Noticed that RangeQueryIntegrationTest is taking ~approx 20 - 30min to run
Upon deep dive in logs, noticed that there were error for consumer rebalancing and test was stuck in loop
Seems like due to same application.id across tests, Kafka Streams application is failing to track its state correctly across rebalances.

Reviewers: Bill Bejeck <bbejeck@apache.org>
2024-11-25 11:42:02 -05:00
Andrew Schofield d17a149205
KAFKA-17956 Remove Admin.listShareGroups (#17912)
KIP-1043 introduced Admin.listGroups as the way to list all types of groups. As a result, Admin.listShareGroups has been removed. This PR is the final step of the removal.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-25 22:05:35 +08:00
Manikumar Reddy 3268435fd6
KAFKA-18013: Add AutoOffsetResetStrategy internal class (#17858)
- Deprecates OffsetResetStrategy enum
- Adds new internal class AutoOffsetResetStrategy
- Replaces all OffsetResetStrategy enum usages with AutoOffsetResetStrategy
- Deprecate old/Add new constructors to MockConsumer

 Reviewers: Andrew Schofield <aschofield@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2024-11-25 19:11:12 +05:30
A. Sophie Blee-Goldman 87b902d35d
KAFKA-18026: KIP-1112, ProcessorWrapper API with PAPI and partial DSL implementation (#17892)
This PR includes the API for KIP-1112 and a partial implementation, which wraps any processors added through the PAPI and the DSL processors that are written to the topology through the ProcessorParameters#addProcessorTo method.

Further PRs will complete the implementation by converting the remaining DSL operators to using the #addProcessorTo method, and future-proof the processor writing mechanism to prevent new DSL operators from being implemented incorrectly/without the wrapper

Reviewers: Almog Gavra <almog@responsive.dev>, Guozhang Wang <guozhang.wang.us@gmail.com>
2024-11-23 21:19:19 -08:00
Laxman Ch d36b24f45f
KAFKA-17299: Fix Kafka Streams consumer hang issue (#17899)
When Kafka Streams skips overs corrupted messages, it might not resume previously paused partitions,
if more than one record is skipped at once, and if the buffer drop below the max-buffer limit at the same time.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-11-22 18:32:00 -08:00
Joao Pedro Fonseca Dantas 866f0cc308
KAFKA-16339: [3/4 KStream#transformValues] Remove Deprecated "transformer" methods and classes (#17266)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-11-22 15:07:03 -08:00
Matthias J. Sax 240efbb99d
MINOR: improve JavaDocs for Kafka Streams exceptions and error handlers (#17856)
Reviewers: Bill Bejeck <bill@confluent.io>
2024-11-21 11:46:23 -08:00
Matthias J. Sax 2519e4af0c
KAFKA-18038: fix flakey test StreamThreadTest.shouldLogAndRecordSkippedRecordsForInvalidTimestamps (#17889)
With KAFKA-17872, we changed some internals that effects the conditions
of this test, introducing a race condition when the expected log
messages are printed.

This PR adds additional wait-conditions to the test to close the race
condition.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-11-21 11:42:28 -08:00
Bill Bejeck fd9de50de1
KAFKA-18041: Update key for storing global consumer instance id for consistency (#17869)
This PR updates the key for storing the KIP-714 client instance id for the global consumer to follow a more consistent pattern of the other embedded Kafka Streams consumer clients.

Reviewers: Matthias Sax <mjsax@apache.org>
2024-11-20 16:14:03 -05:00
Sebastien Viale 615c8c0e11
KAFKA-17850: fix leaking internal exception in state manager (#17711)
Following the KIP-1033 a FailedProcessingException is passed to the Streams-specific uncaught exception handler.

The goal of the PR is to unwrap a FailedProcessingException into a StreamsException when an exception occurs during the flushing or closing of a store

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-11-19 10:51:07 +01:00
Nick Telford 57299cfbb1
KAFKA-17954: Error getting oldest-iterator-open-since-ms from JMX (#17713)
The thread that evaluates the gauge for the oldest-iterator-open-since-ms runs concurrently
with threads that open/close iterators (stream threads and interactive query threads). This PR
fixed a race condition between `openIterators.isEmpty()` and `openIterators.first()`, by catching
a potential exception. Because we except the race condition to be rare, we rather catch the
exception in favor of introducing a guard via locking.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2024-11-18 17:45:49 -08:00
Bill Bejeck 50c15b94c9
KAFKA-17561: KIP-1091 add operator metrics (#17820)
Implementation of KIP-1091 adding operator metrics to Kafka Streams
Updated existing tests to validate added metrics
Reviewers: Bruno Cadonna <cadonna@apache.org>, Matthias Sax <mjsax@apache.org>
2024-11-18 10:30:09 -05:00
TengYao Chi 84fe66827d
KAFKA-18006: Add 3.9.0 to end-to-end test (streams) (#17800)
This commit adds AK 3.9 to the system tests on trunk.
Follow-up of #17797

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bruno Cadonna <cadonna@apache.org>
2024-11-15 14:58:24 +01:00
Matthias J. Sax f02c28b21d
KAFKA-17994 Checked exceptions are not handled (#17817)
Reviewers: Bill Bejeck <bill@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-11-15 20:36:03 +08:00
David Arthur 48ff6a6b53
MINOR Fix a few test names (#17788)
Remove or update custom display names to make sure we actually include the test method as the first part of the display name.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Bill Bejeck <bill@confluent.io>
2024-11-13 13:28:38 -05:00
Bill Bejeck a22fe10544
Update javadoc on split to mention first matching (#17799)
Clarify the functionality of split matching on first predicate
Reviewers: Matthias Sax <mjsax@apache.org>
2024-11-13 11:41:48 -05:00
Rajini Sivaram 52d2fa5c8b
KAFKA-17885: Enable clients to rebootstrap based on timeout or error code (KIP-1102) (#17720)
Implementation of https://cwiki.apache.org/confluence/display/KAFKA/KIP-1102%3A+Enable+clients+to+rebootstrap+based+on+timeout+or+error+code
- Introduces rebootstrap trigger interval config metadata.recovery.rebootstrap.trigger.ms, set to 5 minutes by default
- Makes rebootstrap the default for metadata.recovery.strategy
- Adds new error code REBOOTSTRAP_REQUIRED, introduces top-level error code in metadata response. On this error, clients rebootstrap.
- Configs apply to producers, consumers, share consumers, admin clients, Connect and KStreams clients.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>,  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-11-13 13:01:08 +00:00
Colin Patrick McCabe 085b27ec6e
KAFKA-17987 Remove assorted ZK-related files (#17768)
Remove zookeeper files in bin:
- bin/zookeeper-security-migration.sh
- bin/zookeeper-server-start.sh
- bin/zookeeper-server-stop.sh
- bin/zookeeper-shell.sh

Remove files used to configure Kafka in zookeeper mode in config:
- config/server.properties
- config/zookeeper.properties

Remove ZK references from all remaining Kafka configuration files.

Remove ZK references from all log4j.properties files.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-13 20:32:18 +08:00
Danica Fine 9682e63c11
KAFKA-17109: Reduce log message load for failed locking (#16705)
Reducing log messaging by removing stacktrace.

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-11-13 12:32:40 +01:00
Sebastien Viale c8f360c5f5
KAFKA-17744: Improve state updater logs when restorating state (#17714)
The logs for Kafka Streams local state restoration incorrectly refer to the StreamThread instead of the StateUpdater thread, which is responsible for decoupling the restoration process. The restore consumer also references StreamThread instead of StateUpdater. 

This commit corrects the log message for more clarity.

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-11-12 17:20:44 +01:00
Nick Telford a696b4d6f4
KAFKA-17978: Fix invalid topology on Task assignment (#17778)
When we introduced "startup tasks" in #16922, we initialized them with
no input partitions, because they aren't known until assignment.

However, when we update them during assignment, it's possible that we
update the topology with the incorrect source topics for some internal
topics, due to a difference in the way internal topics are handled for
StandbyTasks.

To resolve this, we now initialize startup tasks with the correct input
partitions, by calculating them from the Topology.

When we assign our startup tasks, we now conditionally update their
input partitions only if they've actually changed, just as we do for
regular StandbyTasks.

With this, the E2E tests now pass, as expected.

Reviewer: Bruno Cadonna <cadonna@apache.org>
2024-11-12 17:18:42 +01:00
Matthias J. Sax 0bc91be145
KAFKA-17872: Update consumed offsets on records with invalid timestamp (#17710)
TimestampExtractor allows to drop records by returning a timestamp of -1. For this case, we still need to update consumed offsets to allows us to commit progress.

Reviewers: Bill Bejeck <bill@confluent.io>
2024-11-09 17:21:16 -08:00
A. Sophie Blee-Goldman 32d9dec9e1
rebase to fix merge conflict (#17702)
Fixes an issue with the TTD in the specific case where users don't specify an initial time for the driver and also don't specify a start timestamp for the TestInputTopic, then pipe input records without timestamps. This combination results in a slight mismatch in the expected timestamps for the piped records, which can be noticeable when writing tests with very small time deltas.

The problem is that, while both the TTD and the TestInputTopic will be initialized to the "current time" when not otherwise specified, it's possible for some milliseconds to have passed between the creation of the TTD and the creation of the TestInputTopic. This can result in a TestInputTopic getting a start timestamp that's several ms larger than the driver's time, and ultimately causing the piped input records to have timestamps slightly in the future relative to the driver.

In practice even those who hit this issue might not notice it if they aren't manipulating time in their tests, or are advancing time by enough to negate the several-milliseconds of difference. However we noticed a test fail due to this because we were testing a ttl-based processor and had advanced the driver time by only 1 millisecond past the ttl. The piped record should have been expired, but because it's timestamp was a few milliseconds longer than the driver's start time, this test ended up failing.

Reviewers: Matthias Sax <mjsax@apache.org>, Bruno Cadonna <cadonna@apache.org>, Lucas Brutschy < lbrutschy@confluent.io>
2024-11-08 19:04:07 -08:00
Joao Pedro Fonseca Dantas 95650431df
KAFKA-16339: [2/4 KStream#flatTransform] Remove Deprecated "transformer" methods and classes (#17245)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-11-07 17:35:17 -08:00
Bill Bejeck c69a6b0e80
KAFKA-17248 - KIP 1076 Add process-id to get carried to telemetry results (#17630)
This PR adds the processId to Kafka Streams client instance metrics

Reviewers: Matthias Sax <mjsax@apache.org>
2024-11-07 12:12:42 -05:00
Matthias J. Sax f2b19baee0
KIP-16331: Remove EOS-v1 from StreamsConfigUtils (#17691)
Reviewers: Bill Bejeck <bill@confluent.io>
2024-11-06 18:18:49 -08:00
Bill Bejeck d170b52362
KAFKA-17635: Ensure only committed offsets are returned for purging (#17686)
Kafka Streams actively purges records from repartition topics. Prior to this PR, Kafka Streams would retrieve the offset from the consumedOffsets map, but here are a couple of edge cases where the consumedOffsets can get ahead of the commitedOffsets map. In these cases, this means Kafka Streams will potentially purge a repartition record before it's committed.

Updated the current StreamTask test to cover this case

Reviewers: Matthias Sax <mjsax@apache.org>
2024-11-06 17:45:27 -05:00
Andrew Schofield 8cbd2edfe7
KAFKA-17896: Admin.describeClassicGroups (#17680)
The implementation of Admin.describeClassicGroups from KIP-1043.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2024-11-06 17:14:10 +05:30
Abhishek Giri c903bdf496
KAFKA-12827 Remove Deprecated method KafkaStreams#setUncaughtExceptionHandler (#16988)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-11-05 22:08:32 -08:00
Joao Pedro Fonseca Dantas 069667b6b2
KAFKA-16339: [1/4 KStream#transform] Remove Deprecated "transformer" methods and classes (#17198)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-11-05 22:04:41 -08:00
Bill Bejeck 4ed0a958e5
KAFKA-17248 - KIP 1076 implementation (#17021)
Implementation of KIP-1076 to allow for adding client application metrics to the KIP-714 framework

Reviewers: Apoorv Mittal <amittal@confluent.io>, Andrew Schofield <aschofield@confluent.io>, Matthias Sax <mjsax@apache.org>
2024-11-05 11:29:54 -05:00
Kuan-Po Tseng e3f953483c
KAFKA-17857 Move AbstractResetIntegrationTest and subclasses to tools (#17594)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-05 04:16:19 +08:00
Linsiyuan9 af53758746
KAFKA-17814 Use `final` declaration to replace the suppression `this-escape` (#17613)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-03 15:00:02 +08:00
Bill Bejeck 908dfa30d7
MINOR: Update clientInstanceIds from EOS_V2 refactor (#17664)
Updates KafkaStreams.clientInstanceIds method to correctly populate the client-id -> clientInstanceId map that was altered in a previous refactoring.

Added a test that confirms ClientInstanceIds is correctly storing consumer and producer instance ids

Reviewers: Matthias Sax <mjsax@apache.org>
2024-11-02 10:37:46 -04:00
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