Commit Graph

6093 Commits

Author SHA1 Message Date
Ismael Juma 7d9e93ac6d
MINOR: Use https instead of http in links (#6477)
Verified that the https links work.

I didn't update the license header in this PR since that touches
so many files. Will file a separate one for that.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-04-22 11:58:25 -07:00
Matthias J. Sax 172fbb2dd5
MINOR: Add unit test for SerDe auto-configuration (#6610)
Reviewers: Guozhang Wang <guozhang@confluent.io>, Ted Yu <yuzhihong@gmail.com>
2019-04-22 10:15:46 -07:00
David Arthur 409fabc561 KAFKA-7747; Check for truncation after leader changes [KIP-320] (#6371)
After the client detects a leader change we need to check the offset of the current leader for truncation. These changes were part of KIP-320: https://cwiki.apache.org/confluence/display/KAFKA/KIP-320%3A+Allow+fetchers+to+detect+and+handle+log+truncation.

Reviewers: Jason Gustafson <jason@confluent.io>
2019-04-21 16:24:18 -07:00
Ted Yu e56ebbffca [KAFKA-3729] Auto-configure non-default SerDes passed alongside the topology builder (#6461)
Reviewers: Matthias J. Sax <matthias@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-04-20 11:30:20 -07:00
Bob Barrett 964e90a725 MINOR: Remove errant lock.unlock() call from RoundTripWorker (#6612)
Reviewers: Colin P. McCabe <cmccabe@apache.org>
2019-04-20 10:43:35 -07:00
John Roesler 6538e9e4d6 KAFKA-7895: fix Suppress changelog restore (#6536)
Several issues have come to light since the 2.2.0 release:
upon restore, suppress incorrectly set the record metadata using the changelog record, instead of preserving the original metadata
restoring a tombstone incorrectly didn't update the buffer size and min-timestamp

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Matthias J. Sax <mjsax@apache.org>,  Bruno Cadonna <bruno@confluent.io>,  Bill Bejeck <bbejeck@gmail.com>
2019-04-20 11:08:32 -04:00
Matthias J. Sax 3aa909575d
MINOR: Java8 cleanup (#6598)
Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-04-19 18:44:27 -07:00
Matthias J. Sax c596204c0d
MINOR: Java8 cleanup (#6599)
Reviewers: Bill Bejeck <bill@confluent.io>, Bruno Cadonna <bruno@confluent.io>
2019-04-19 18:29:27 -07:00
Jason Gustafson e32d33cd4f KAFKA-7965; Fix flaky test ConsumerBounceTest
We suspect the problem might be a race condition after broker startup where the consumer has yet to find the coordinator and rebalance. The fix here rolls all the brokers first and then waits for the expected exception.

Author: Jason Gustafson <jason@confluent.io>

Reviewers: Gwen Shapira

Closes #6608 from hachikuji/KAFKA-7965
2019-04-19 16:43:06 -07:00
Florian Hussonnois 075b368d47 KAFKA-6958: Allow to name operation using parameter classes (#6410)
This is the 2nd PR for the KIP-307
Reviewers: Matthias J. Sax <mjsax@apache.org>,  John Roesler <john@confluent.io>, Bill Bejeck <bbejeck@gmail.com>
2019-04-18 18:45:33 -04:00
John Roesler 7b4b298edd HOTFIX: Fix compilation error in `ProducerStateManagerTest` (#6603)
Reviewers: Jason Gustafson <jason@confluent.io>
2019-04-18 09:38:54 -07:00
Jason Gustafson 6964c356aa
KAFKA-7866; Ensure no duplicate offsets after txn index append failure (#6570)
This patch fixes a bug in the append logic which can cause duplicate offsets to be appended to the log when the append to the transaction index fails. Rather than incrementing the log end offset after the index append, we do it immediately after the records are written to the log. If the index append later fails, we do two things:

1) We ensure that the last stable offset cannot advance. This guarantees that the aborted data will not be returned to the user until the transaction index contains the corresponding entry.
2) We skip updating the end offset of the producer state. When recovering the log, we will have to reprocess the log and write the index entries.

Reviewers: Jun Rao <junrao@gmail.com>
2019-04-18 08:41:32 -07:00
Jason Gustafson 48179677a7
MINOR: Ensure producer state append exceptions areuseful (#6591)
We should include partition/offset information when we raise exceptions during producer state validation. This saves a lot of the discovery work to figure out where the problem occurred. This patch also includes a new test case to verify additional coordinator fencing cases.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
2019-04-18 08:38:43 -07:00
Vahid Hashemian 3e8a10e7d9 KAFKA-7026; Sticky Assignor Partition Assignment Improvement (KIP-341) (#5291)
This patch contains the implementation of KIP-341, which adds protection in the sticky assignor from consumers which are joining with a stale assignment. More details can be found in the proposal: https://cwiki.apache.org/confluence/display/KAFKA/KIP-341%3A+Update+Sticky+Assignor%27s+User+Data+Protocol.

Reviewers: Steven Aerts <steven.aerts@gmail.com>, Jason Gustafson <jason@confluent.io>
2019-04-18 08:35:24 -07:00
A. Sophie Blee-Goldman 0f7a87e93d KAFKA-7652: Restrict range of fetch/findSessions in cache (#6448)
Reduce the total key space cache iterators have to search for segmented byte stores by wrapping several single-segment iterators.

Summary of Benchmarking Results (# records processed as primary indicator)

Session Store:
Only single-key findSessions seems to benefit (~4x improvement) due to conservative scanning of potentially variable-sized keys in key-range findSessions. Could get improvement from key-range findSessions as well if we can tell when/if keys are a fixed size, or pending an efficient custom comparator API from RocksDB

Window Store:
Both single and multi-key fetch saw some improvement; this depended on the size of the time-range in the fetch (in the DSL this would be window size) relative to the retention period. Performance benefits from this patch when the fetch spans multiple segments; hence the larger the time range being searched, the better this will do.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Bill Bejeck <bbejeck@gmail.com>
2019-04-17 16:42:49 -07:00
A. Sophie Blee-Goldman c7836307c3 [HOT FIX] Check for null before deserializing in MeteredSessionStore (#6575)
The fetchSession() method of SessionStore searches for a (single) specific session and returns null if none are found. This is analogous to fetch(key, time) in WindowStore or get(key) in KeyValueStore. MeteredWindowStore and MeteredKeyValueStore both check for a null result before attempting to deserialize, however MeteredSessionStore just blindly deserializes and as a result NPE is thrown when we search for a record that does not exist.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Bill Bejeck <bbejeck@gmail.com>, Bruno Cadonna <bruno@confluent.io>
2019-04-17 19:21:59 -04:00
A. Sophie Blee-Goldman 555d05971e Added note to RocksDBConfigSetter (#6578)
Reviewers: Matthias J. Sax <mjsax@apache.org>,  John Roesler <john@confluent.io>, Bill Bejeck <bbejeck@gmail.com>
2019-04-17 17:17:32 -04:00
huxi a05eaaa8f4 KAFKA-7965; Fix testRollingBrokerRestartsWithSmallerMaxGroupSizeConfigDisruptsBigGroup (#6557)
Most of the time, the group coordinator runs on broker 1. Occasionally the group coordinator will be placed on broker 2. If that's the case, the loop starting at line 320 have no chance to check and update `kickedOutConsumerIdx`. A quick fix is to safely do another round of loop to ensure `kickedOutConsumerIdx` always be checked after the last broker restart.

Reviewers: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>, Jason Gustafson <jason@confluent.io>
2019-04-17 12:41:46 -07:00
Rajini Sivaram 7f9b9a60da
KAFKA-8241; Handle configs without truststore for broker keystore update (#6585)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-04-17 18:17:40 +01:00
Matthias J. Sax 0e08358da4
KAFKA-6455: KStream-KStream join should set max timestamp for result record (#6565)
Reviewers: John Roesler <john@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-04-17 09:07:25 -07:00
pkleindl 5919e73e5d MINOR: fixed missing close of Iterator, used try-with-resource where appropriate (#6562)
Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-04-16 16:44:17 -07:00
Manikumar Reddy 3b1524c5df KAFKA-7466: Add IncrementalAlterConfigs API (KIP-339) (#6247)
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Viktor Somogyi <viktorsomogyi@gmail.com>, Stanislav Kozlovski <stanislav_kozlovski@outlook.com>, Rajini Sivaram <rajinisivaram@googlemail.com>, Ismael Juma <ismael@juma.me.uk>
2019-04-16 16:26:33 -07:00
John Roesler 99ce7d76ce KAFKA-7778: document scala suppress API (#6586)
Document the minor API change.

Reviewers: Casey Green <greenc421@gmail.com>, Guozhang Wang <wangguoz@gmail.com>,  Bill Bejeck <bbejeck@gmail.com>
2019-04-16 13:48:58 -07:00
cadonna 05668e98f5 KAFKA-7875: Add KStream.flatTransformValues (#6424)
Adds flatTrasformValues methods in KStream
Adds processor supplier and processor for flatTransformValues
Improves API documentation of transformValues

Reviewers: Matthias J. Sax <mjsax@apache.org>,  John Roesler <john@confluent.io>, Bill Bejeck <bbejeck@gmail.com>
2019-04-16 12:10:38 -04:00
Alex Dunayevsky 47a9871ef6 KAFKA-7471: Multiple Consumer Group Management Feature (#5726)
* Describe/Delete/Reset offsets on multiple consumer groups at a time (including each group by repeating `--group` parameter)
* Describe/Delete/Reset offsets on ALL consumer groups at a time (add new `--all-groups` option similar to `--all-topics`)
* Reset plan CSV file generation reworked: structure updated to support multiple consumer groups and make sure that CSV file generation is done properly since there are no restrictions on consumer group names and symbols like commas and quotes are allowed.
* Extending data output table format by adding `GROUP` column for all `--describe` queries
2019-04-15 16:53:28 -07:00
Casey Green b7d7f7590d KAFKA-7778: Add KTable.suppress to Scala API (#6314)
Detailed description

* Adds KTable.suppress to the Scala API.
* Fixed count in KGroupedStream, SessionWindowedKStream, and TimeWindowedKStream so that the value serde gets passed down to the KTable returned by the internal mapValues method.
* Suppress API support for Java 1.8 + Scala 2.11

Testing strategy

I added unit tests covering:

* Windowed KTable.count.suppress w/ Suppressed.untilTimeLimit
* Windowed KTable.count.suppress w/ Suppressed.untilWindowCloses
* Non-windowed KTable.count.suppress w/ Suppressed.untilTimeLimit
* Session-windowed KTable.count.suppress w/ Suppressed.untilWindowCloses

Reviewers: John Roesler <john@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-04-15 16:27:19 -07:00
Viktor Somogyi 7bd81628d9 KAFKA-6635; Producer close awaits pending transactions (#5971)
Currently close() only awaits completion of pending produce requests. If there is a transaction ongoing, it may be dropped. For example, if one thread is calling commitTransaction() and another calls close(), then the commit may never happen even if the caller is willing to wait for it (by using a long timeout). What's more, the thread blocking in commitTransaction() will be stuck since the result will not be completed once the producer has shutdown. 

This patch ensures that 1) completing transactions are awaited, 2) ongoing transactions are aborted, and 3) pending callbacks are completed before close() returns.

Reviewers: Jason Gustafson <jason@confluent.io>
2019-04-15 15:56:36 -07:00
Sönke Liebau 9495b5f991 MINOR: Mention in configuration of broker setting log.retention.ms that -1 disables retention by time (#6464)
Includes an update to the relevant configuration doc.
2019-04-15 07:23:50 -07:00
Rajini Sivaram 51a67d52cb
KAFKA-8232; Test topic delete completion rather than intermediate state (#6581)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-04-15 12:42:23 +01:00
Bill Bejeck 312e55bf56
KAFKA-8208: Change paper link directly to ASM (#6572)
Reviewers: Matthias J. Sax <mjsax@apache.org>, Victoria Bialas <vicky@confluent.io>
2019-04-13 18:59:40 -04:00
Bill Bejeck 5e2d062267
KAFKA-8210: Fix link for streams table duality (#6573)
Reviewers: Victoria Bialas <vicky@confluent.io>
2019-04-13 18:54:06 -04:00
Bill Bejeck 75dc7e2b6b
KAFKA-8209: Wrong link for KStreams DSL in core concepts doc (#6564)
Reviewers Matthias J. Sax <mjsax@apache.org>, Michael Drogalis <michael.drogalis@confluent.io>, Victoria Bialas <vicky@confluent.io>
2019-04-13 18:50:27 -04:00
Victoria Bialas ad0f7aead7 KAFKA-8212 DOCS (kafka) - Fix Maven artifacts table from cutting off text (#6576)
Reviewer: Matthias J. Sax <matthias@confluent.io>
2019-04-13 15:43:51 -07:00
Victoria Bialas 8bd66eb870 KAFKA-8213 - Fix typo in Streams Dev Guide (#6574)
Reviewers: Jim Galasyn <jim.galasyn@confluent.io>, Joel Hamill <joel@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2019-04-13 15:35:47 -07:00
Jason Gustafson 02221bd907
MINOR: Remove SubscriptionState.Listener and replace with assignmentId tracking (#6559)
We have not had great experience with listeners. They make the code harder to understand because they result in indirectly maintained circular dependencies. Often this leads to tricky deadlocks when we try to introduce locking. We were able to remove the Metadata listener in KAFKA-7831. Here we do the same for the listener in SubscriptionState.

Reviewers: Viktor Somogyi-Vass <viktorsomogyi@gmail.com>, Rajini Sivaram <rajinisivaram@googlemail.com>
2019-04-11 11:55:14 -07:00
Colin Patrick McCabe 04a023e302
MINOR: ConnectionStressWorker: add missing executor shutdown (#6558) 2019-04-11 11:16:06 -07:00
Jason Gustafson 53e95ffcdb
MINOR: Use generated InitProducerId RPC (#6538)
This patch updates the InitProducerId request API to use the generated sources. It also fixes a small bug in the DescribeAclsRequest class where we were using the wrong api key.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Colin McCabe <cmccabe@apache.org>
2019-04-11 08:27:08 -07:00
A. Sophie Blee-Goldman 9f5a69a4c2 [MINOR] Guard against crashing on invalid key range queries (#6521)
Due to KAFKA-8159, Streams will throw an unchecked exception when a caching layer or in-memory underlying store is queried over a range of keys from negative to positive. We should add a check for this and log it then return an empty iterator (as the RocksDB stores happen to do) rather than crash

Reviewers: Bruno Cadonna <bruno@confluent.io> Bill Bejeck <bbejeck@gmail.com>
2019-04-10 15:10:47 -04:00
Rajini Sivaram 950cfe3e70 MINOR: Add security considerations for remote JMX in Kafka docs (#6544)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-04-10 12:39:11 +05:30
highluck 0667fe2bfd MINOR: Remove redundant access specifiers from metrics interfaces (#6527)
Reviewers: Sönke Liebau <soenke.liebau@opencore.com>, Ismael Juma <ismael@juma.me.uk>
2019-04-09 11:20:37 +02:00
cadonna 97bca4d3f5 MINOR: Correct KStream documentation (#6552)
Reviewers: Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2019-04-08 22:36:46 -07:00
Konstantine Karantasis 1bf1e46e7e KAFKA-8013; Avoid underflow when reading a Struct from a partially correct buffer (#6340)
Protocol compatibility can be facilitated if a Struct, that has been defined as an extension of a previous Struct by adding fields at the end of the older version, can read a message of an older version by ignoring the absence of the missing new fields. Reading the missing fields should be allowed by the definition of these fields (they have to be nullable) when supported by the schema.

Reviewers: David Arthur <mumrah@gmail.com>, Randall Hauch <rhauch@gmail.com>, Jason Gustafson <jason@confluent.io>
2019-04-08 14:24:00 -07:00
Chris Egerton 71e721f135 KAFKA-8058: Fix ConnectClusterStateImpl.connectors() method (#6384)
Fixed the ConnectClusterStateImpl.connectors() method and throw an exception on timeout. Added unit test.

Author: Chris Egerton <chrise@confluent.io>

Reviewers: Magesh Nandakumar <magesh.n.kumar@gmail.com>, Robert Yokota <rayokota@gmail.com>, Arjun Satish <wicknicks@users.noreply.github.com>, Konstantine Karantasis <konstantine@confluent.io>, Randall Hauch <rhauch@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #6384 from C0urante:kafka-8058
2019-04-07 09:43:09 -05:00
Jason Gustafson db338ef67c
MINOR: Move common consumer tests out of abstract consumer class (#6548)
ConsumerBounceTest redundantly executes a couple test cases which were included in the abstract class `BaseConsumerTest`. We should try to keep a cleaner separation of testing logic and utility logic so that this does not happen (the build time is long enough without doing unnecessary work). This PR moves the cluster initialization and consumer utilities out of BaseConsumerTest and into a new class AbstractConsumerTest. We then let ConsumerBounceTest extend AbstractConsumerTest.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2019-04-05 15:33:37 -07:00
Colin P. Mccabe 62381bd915 KAFKA-8168; Add a generated ApiMessageType class
Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Gwen Shapira

Closes #6510 from cmccabe/KAFKA-8168
2019-04-05 15:27:34 -07:00
Stanislav Kozlovski cc4fde35c9 KAFKA-7893; Refactor ConsumerBounceTest to reuse functionality from BaseConsumerTest (#6238)
This PR should help address the flakiness in the ConsumerBounceTest#testRollingBrokerRestartsWithSmallerMaxGroupSizeConfigDisruptsBigGroup test (https://issues.apache.org/jira/browse/KAFKA-7965). I tested this locally and have verified it significantly reduces flakiness - 25/25 tests now pass. Running the test 25 times in trunk, I'd get `18/25` passes.

It does so by reusing the less-flaky consumer integration testing functionality inside `BaseConsumerTest`. Most notably, the test now makes use of the `ConsumerAssignmentPoller` class  - each consumer now polls non-stop rather than the more batch-oriented polling we had in `ConsumerBounceTest#waitForRebalance()`.

Reviewers: Jason Gustafson <jason@confluent.io>
2019-04-05 13:08:04 -07:00
Guozhang Wang 4aa2cfe467
MINOR: Tighten up metadata upgrade test (#6531)
Reviewers: Bill Bejeck <bbejeck@gmail.com>
2019-04-05 12:50:42 -07:00
Rajini Sivaram 844120c601
KAFKA-8190; Don't update keystore modification time during validation (#6539)
Ensure that modification time is checked against the file used to create the SSLContext that is in-use so that SSLContext is updated whenever file is modified and a config update request is received.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-04-05 19:42:28 +01:00
Mickael Maison 825fa3fa09 MINOR: Fixed a few warning in core and connects (#6545)
- var -> val
- unused imports
- Javadoc fix

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-04-05 23:30:48 +05:30
Kevin Lu 31d191fc85 KAFKA-7904; Add AtMinIsr partition metric and TopicCommand option (KIP-427)
- Add `AtMinIsrPartitionCount` metric to `ReplicaManager`
- Add `AtMinIsr` metric to `Partition`
- Add `--at-min-isr-partitions` describe `TopicCommand` option

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103089398

Author: Kevin Lu <lu.kevin@berkeley.edu>
Author: lu.kevin@berkeley.edu <kelu@paypal.com>

Reviewers: Gwen Shapira

Closes #6421 from KevinLiLu/KAFKA-7904
2019-04-05 09:14:41 -07:00