Commit Graph

2082 Commits

Author SHA1 Message Date
dengziming 88eb24db40
KAFKA-12637: Remove deprecated PartitionAssignor interface (#10512)
Remove PartitionAssignor and related classes, update docs and move unit test

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-04-12 18:37:01 -07:00
A. Sophie Blee-Goldman c608d8480e
KAFKA-7606: Remove deprecated options from StreamsResetter (#10411)
Remove deprecated --zookeeper and --execute flags

Reviewers: Matthias J. Sax <mjsax@confluent.io>
2021-04-12 18:24:18 -07:00
Marco Aurelio Lotz e677782112
KAFKA-9527: fix NPE when using time-based argument for Stream Resetter Tool (#10042)
Reviewers: Jorge Esteban Quilcate Otoya <quilcate.jorge@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2021-04-12 09:28:23 -07:00
Matthias J. Sax 872b44455c
HOTFIX: delete removed WindowedStore.put() method (#10517)
Reviewers: Boyang Chen <boyang@confluent.io>
2021-04-09 14:58:44 -07:00
Jorge Esteban Quilcate Otoya c9cab2beb8
KAFKA-8410: Migrate KStream Stateless operators to new Processor API (#10381)
Migrate KStream stateless operators to new Processor API.
Following PRs will complete migration of KStream stateful operators and KTable.
No expected functionality changes.

Reviewers: John Roesler <vvcephei@apache.org>
2021-04-09 14:49:54 -05:00
Luke Chen f76b8e4938
KAFKA-9831: increase max.poll.interval.ms to avoid unexpected rebalance (#10301)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2021-04-09 12:19:14 -07:00
Jorge Esteban Quilcate Otoya db0323e9ba
KAFKA-12449: Remove deprecated WindowStore#put (#10293)
Removes `WindowStore#put(K,V)` that was deprecated via KIP-474.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2021-04-09 11:49:37 -07:00
Guozhang Wang aa0f450dad
KAFKA-12630: Remove deprecated KafkaClientSupplier#getAdminClient in Streams (#10502)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>
2021-04-08 08:39:51 -07:00
A. Sophie Blee-Goldman e9c5a3995a
MINOR: un-deprecate StreamsConfig overloads to support dependency injection (#10484)
In #5344 it came to our attention that the StreamsConfig overloads of the KafkaStreams constructors are actually quite useful for dependency injection, providing a cleaner way to configure dependencies and better type safety.

Reviewers: Matthias J. Sax <mjsax@confluent.io>
2021-04-07 21:13:32 -07:00
Guozhang Wang 3ca5a3bb78
KAFKA-12568: Remove deprecated APIs in KStream, KTable and Joined (#10421)
This is related to KIP-307 / KIP-372 / KIP-479.

Reviewers: John Roesler <vvcephei@apache.org>
2021-04-07 17:38:43 -07:00
Guozhang Wang 04f47c54c2
KAFKA-12527: Remove deprecated PartitionGrouper annotation (#10380)
A quick follow-up rebased on https://github.com/apache/kafka/pull/10302 to remove deprecated annotation.
2021-04-07 13:57:12 -07:00
high.lee 00ec646c5a
KAFKA-7785: move internal DefaultPartitionGrouper (#10302)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2021-04-07 13:36:39 -07:00
Sergio Peña 37493d1e18
KAFKA-10847: Add new RocksDBTimeOrderedWindowStore that persists (time-key)-value records (#10331)
This new store is more efficient when calling range queries with only time parameters, like `fetch(from, to)`. For range queries using key ranges, then the current RocksDBWindowStore should be used.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2021-04-07 13:35:12 -07:00
Ismael Juma 2f36001987
KAFKA-12579: Remove various deprecated clients classes/methods for 3.0 (#10438)
* Remove `ExtendedSerializer` and `ExtendedDeserializer`, deprecated since 2.1.
The extra functionality was also made available in `Serializer` and `Deserializer`.
* Remove `close(long, TimeUnit)` from the producer, consumer and admin client,
deprecated since 2.0 for the consumer and 2.2 for the rest. The replacement is `close(Duration)`.
* Remove `ConsumerConfig.addDeserializerToConfig` and `ProducerConfig.addSerializerToConfig`,
deprecated since 2.7 with no replacement. These methods were not intended to be public API
and are likely not used much (if at all).
* Remove `NoOffsetForPartitionException.partition()`, deprecated since 0.11. `partitions()`
should be used instead.
* Remove `MessageFormatter.init(Properties)`, deprecated since 2.7. The `configure(Map)`
method should be used instead.
* Remove `kafka.common.MessageFormatter`, deprecated since 2.7.
`org.apache.kafka.common.MessageFormatter` should be used instead.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>
2021-04-06 08:54:53 -07:00
John Roesler 4ed7f2cd01
KAFKA-12593: Fix Apache License headers (#10452)
* Standardize license headers in scala, python, and gradle files.
* Relocate copyright attribution to the NOTICE.
* Add a license header check to `spotless` for scala files.

Reviewers: Ewen Cheslack-Postava <ewencp@apache.org>, Matthias J. Sax <mjsax@apache.org>, A. Sophie Blee-Goldman <ableegoldman@apache.org
2021-04-01 10:38:37 -05:00
A. Sophie Blee-Goldman 3eff8d39f1
HOTFIX: move rebalanceInProgress check to skip commit during handleCorrupted (#10444)
Minor followup to #10407 -- we need to extract the rebalanceInProgress check down into the commitAndFillInConsumedOffsetsAndMetadataPerTaskMap method which is invoked during handleCorrupted, otherwise we may attempt to commit during a a rebalance which will fail

Reviewers: Matthias J. Sax <mjsax@confluent.io>
2021-03-30 18:55:38 -07:00
A. Sophie Blee-Goldman 0189298d86
KAFKA-12288: remove task-level filesystem locks (#10342)
The filesystem locks don't protect access between StreamThreads, only across different instances of the same Streams application. Running multiple processes in the same physical state directory is not supported, and as of PR #9978 it's explicitly guarded against), so there's no reason to continue locking the task directories with anything heavier than an in-memory map.

Reviewers: Rohan Desai <rodesai@confluent.io>, Walker Carlson <wcarlson@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2021-03-30 17:02:42 -07:00
ketulgupta1995 617ee00322
KAFKA-12509 Tighten up StateDirectory thread locking (#10418)
Modified LockAndOwner class to have Thread reference instead of just name

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-03-30 12:13:53 -07:00
Walker Carlson e971d94eb3
KAFKA-8784: remove default close for RocksDBConfigSetter (#10416)
Remove the default close implementation for RocksDBConfigSetter to avoid accidental memory leaks via C++ backed objects which are constructed but not closed by the user

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-03-29 14:26:39 -07:00
A. Sophie Blee-Goldman fb2eef94a4
KAFKA-12523: handle TaskCorruption and TimeoutException during handleCorruption and handleRevocation (#10407)
Need to handle TaskCorruptedException and TimeoutException that can be thrown from offset commit during handleRevocation or handleCorruption

Reviewers: Matthias J. Sax <mjsax@confluent.org>, Guozhang Wang <guozhang@confluent.io>
2021-03-29 14:06:22 -07:00
Guozhang Wang d5fd491bf7
KAFKA-7106: remove deprecated Windows APIs (#10378)
1. Remove all deprecated APIs in KIP-328.
2. Remove deprecated APIs in Windows in KIP-358.

Reviewers: John Roesler <vvcephei@apache.org>
2021-03-28 12:33:40 -07:00
Guozhang Wang b8058829bb
KAFKA-12562: Remove deprecated APIs in KafkaStreams and returned state classes (#10412)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>
2021-03-28 12:20:31 -07:00
Walker Carlson f91d592a27
KAFKA-12537: fix application shutdown corner case with only one thread (#10387)
When in EOS the run loop terminates on that thread before the shutdown can be called. This is a problem for EOS single thread applications using the application shutdown feature.

I changed it so in all cases with a single thread, the dying thread will spin up a new thread to communicate the shutdown and terminate the dying thread. Also @ableegoldman refactored the catch blocks in runloop.

Co-authored-by: A. Sophie Blee-Goldman <ableegoldman@gmail.com>

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-03-26 19:55:27 -07:00
Matthias J. Sax 03f13d1c41
KAFKA-12452: Remove deprecated overloads of ProcessorContext#forward (#10300)
ProcessorContext#forward was changed via KIP-251 in 2.0.0 release. This PR removes the old and deprecated overloads.

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>
2021-03-25 19:49:18 -07:00
John Roesler 9ef52dd2db
KAFKA-12508: Disable KIP-557 (#10397)
A major issue has been raised that this implementation of
emit-on-change is vulnerable to a number of data-loss bugs
in the presence of recovery with dirty state under at-least-once
semantics. This should be fixed in the future when we implement
a way to avoid or clean up the dirty state under at-least-once,
at which point it will be safe to re-introduce KIP-557 and
complete it.

Reviewers: A. Sophie Blee-Goldman <ableegoldman@apache.org>
2021-03-25 14:42:26 -05:00
John Roesler 9bf5c57997
KAFKA-12435: Fix javadoc errors (#10392)
There were errors while generating javadoc for the streams:test-utils module
because the included TopologyTestDriver imported some excluded classes.

This fixes the errors by inlining the previously excluded packages.

Reviewers: Chia-Ping Tsai <chia7712@apache.org>, Ismael Juma <ijuma@apache.org>
2021-03-24 13:55:27 -05:00
Chia-Ping Tsai 9af81955c4
KAFKA-12173 Migrate streams:streams-scala module to JUnit 5 (#9858)
1. replace org.junit.Assert by org.junit.jupiter.api.Assertions
2. replace org.junit by org.junit.jupiter.api
3. replace Before by BeforeEach
4. replace After by AfterEach
5. remove ExternalResource from all scala modules
6. add explicit AfterClass/BeforeClass to stop/start EmbeddedKafkaCluster

Noted that this PR does not migrate stream module to junit 5 so it does not introduce callback of junit 5 to deal with beforeAll/afterAll. The next PR of migrating stream module can replace explicit beforeAll/afterAll by junit 5 extension. Or we can keep the beforeAll/afterAll if it make code more readable.

Reviewers: John Roesler <vvcephei@apache.org>
2021-03-25 01:04:39 +08:00
Guozhang Wang 7071ded2a6
KAFKA-12524: Remove deprecated segments() (#10379)
Reviewers: Boyang Chen <boyang@confluent.io>
2021-03-23 21:05:42 -07:00
wenbingshen e0cbd0fa66
MINOR: Remove duplicate definition about 'the' from kafka project (#10370)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-03-23 10:44:55 +08:00
Boyang Chen 80f373d34f
(Cherry-pick) KAFKA-9274: handle TimeoutException on task reset (#10000) (#10372)
This PR was removed by accident in trunk and 2.8, bringing it back.

Co-authored-by: Matthias J. Sax <matthias@confluent.io>
Reviewers: Matthias J. Sax <matthias@confluent.io>
2021-03-22 13:39:29 -07:00
Bill Bejeck a290c8e1df
KAFKA-3745: Add access to read-only key in value joiner (#10150)
This PR implements adding read-only access to the key for KStream.join as described in KIP-149

This PR as it stands does not affect the Streams Scala API. Updating the Streams Scala API will be done in a follow-up PR.
Additionally, the original KIP did not include the KTable API, but I don't see any reason why we wouldn't want the same functionality there as well, this will be done in an additional follow-up PR after updating the existing KIP.

Reviewers: Matthias J. Sax <mjsax@apache.org>
2021-03-20 22:19:01 -04:00
A. Sophie Blee-Goldman 13b4ca8795
KAFKA-12500: fix memory leak in thread cache (#10355)
Need to exclude threads in PENDING_SHUTDOWN from the num live threads computation used to compute the new cache size per thread. Also adds some logging to help follow what's happening when a thread is added/removed/replaced.

Reviewers: Bruno Cadonna <cadonna@confluent.io>, Walker Carlson <wcarlson@confluent.io>, John Roesler <john@confluent.io>
2021-03-19 18:11:07 -07:00
Bruno Cadonna 5dfbefcb37
KAFKA-12508: Emit records with same value and same timestamp (#10360)
Emit on change introduced in Streams with KIP-557 might lead to
data loss if a record is put into a source KTable and emitted
downstream and then a failure happens before the offset could be
committed. After Streams rereads the record, it would find a record
with the same key, value and timestamp in the KTable (i.e. the same
record that was put into the KTable before the failure) and not
forward it downstreams. Hence, the record would never be processed
downstream of the KTable which breaks at-least-once and exactly-once
processing guarantees.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-03-19 15:51:19 -07:00
Walker Carlson 367eca083b
KAFKA-12503: inform threads to resize their cache instead of doing so for them (#10356)
Make it so threads do not directly resize other thread's caches

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-03-18 19:34:39 -07:00
Bruno Cadonna 4be0033e62
KAFKA-10357: Add setup method to internal topics (#10317)
For KIP-698, we need a way to setup internal topics without validating them. This PR adds a setup method to the InternalTopicManager for that purpose.

Reviewers: Rohan Desai <rohan@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2021-03-18 09:52:08 -07:00
Walker Carlson 336d26accf
HOTFIX: timeout issue in removeStreamThread() (#10321)
Timeout is a duration not a point in time.

Reviewers: Bruno Cadonna <cadonna@confluent.io>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-03-15 20:12:37 -07:00
Boyang Chen 8da65936d7
revert stream logging level back to ERROR (#10320)
An accidental change of logging level for streams from #9579, correcting it.

Reviewers: Bill Bejeck <bbejeck@gmail.com>
2021-03-15 11:00:35 -07:00
A. Sophie Blee-Goldman 4fe4cdc4a6
KAFKA-12462: proceed with task revocation in case of thread in PENDING_SHUTDOWN (#10311)
Always invoke TaskManager#handleRevocation when the thread is in PENDING_SHUTDOWN

Reviewers: Walker Carlson <wcarlson@confluent.io>
2021-03-12 20:06:54 -08:00
Bruno Cadonna b519117b22
KAFKA-10357: Add missing repartition topic validation (#10305)
Reviewers: Rohan Desai <rohan@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2021-03-12 08:59:41 -08:00
Bruno Cadonna 800d9b5abc
KAFKA-10357: Add validation method for internal topics (#10266)
For KIP-698, we need a way to validate internal topics before we create them. This PR adds a validation method to the InternalTopicManager for that purpose.

Reviewers: Rohan Desai <rohan@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2021-03-11 09:55:30 -08:00
Matthias J. Sax 50518fa8e0
KAFKA-12441: remove deprecated method StreamsBuilder#addGlobalStore (#10284)
The method StreamsBuilder#addGlobalStore was simplified via KIP-233 in 1.1.0 release. This PR removes the old and deprecated overload.

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2021-03-10 16:14:44 -08:00
Rohit Deshpande 029f5a136a
KAFKA-10062: Add a methods to retrieve the current timestamps as known by the Streams app (#9744)
Implements KIP-622.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2021-03-10 14:26:24 -08:00
Lee Dongjin e6f8f5d0ae
MINOR: Remove unused variables, methods, parameters, unthrown exceptions, and fix typos (#9457)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com
2021-03-10 13:21:30 +08:00
Walker Carlson 207bb0826b
KAFKA-12347: updating TaskMetadata (#10211)
added committed offset, high watermark and idle duration to the taskMetadata.

Reviewers: Boyang Chen <boyang@confluent.io>
2021-03-05 11:27:25 -08:00
A. Sophie Blee-Goldman 23b61ba383
KAFKA-12375: don't reuse thread.id until a thread has fully shut down (#10215)
Always grab a new thread.id and verify that a thread has fully shut down to DEAD before removing from the `threads` list and making that id available again

Reviewers: Walker Carlson <wcarlson@confluent.io>, Bruno Cadonna <cadonna@confluent.io>
2021-03-02 16:28:15 -08:00
Bruno Cadonna a848e0c420
KAFKA-10357: Extract setup of changelog from Streams partition assignor (#10163)
To implement the explicit user initialization of Kafka Streams as
described in KIP-698, we first need to extract the code for the
setup of the changelog topics from the Streams partition assignor
so that it can also be called outside of a rebalance.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Guozhang Wang <guozhang@confluent.io>
2021-03-02 12:00:00 -08:00
vamossagar12 4c5867a39b
KAFKA-10766: Unit test cases for RocksDBRangeIterator (#9717)
This PR aims to add unit test cases for RocksDBRangeIterator which were missing.

Reviewers: Bruno Cadonna <cadonna@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2021-03-02 09:55:14 -08:00
vamossagar12 b2075a0946
KAFKA-12289: Adding test cases for prefix scan in InMemoryKeyValueStore (#10052)
Co-authored-by: Bruno Cadonna <bruno@confluent.io>

Reviewers: Bruno Cadonna <cadonna@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2021-03-02 09:53:27 -08:00
John Roesler a92b986c85
KAFKA-12268: Implement task idling semantics via currentLag API (#10137)
Implements KIP-695

Reverts a previous behavior change to Consumer.poll and replaces
it with a new Consumer.currentLag API, which returns the client's
currently cached lag.

Uses this new API to implement the desired task idling semantics
improvement from KIP-695.

Reverts fdcf8fbf72 / KAFKA-10866: Add metadata to ConsumerRecords (#9836)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Guozhang Wang <guozhang@apache.org>
2021-03-02 08:20:47 -06:00
Luke Chen 020ead4b97
MINOR: Format the revoking active log output in `StreamsPartitionAssignor` (#10242)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>
2021-03-02 10:32:21 +01:00