Commit Graph

6162 Commits

Author SHA1 Message Date
Kengo Seki c638235dbc KAFKA-8344; Fix vagrant-up.sh to work with AWS properly
For now, `vagrant/vagrant-up.sh --aws` fails because
the `vagrant hostmanager` command in that script lacks
the `--aws` option. This PR adds it.

I ran `vagrant/vagrant-up.sh --aws` with and without
`--no-parallel` option and confirmed both worked
as expected.

Author: Kengo Seki <sekikn@apache.org>

Reviewers: Gwen Shapira

Closes #6703 from sekikn/KAFKA-8344
2019-05-09 22:48:23 -07:00
opera443399 96096cebe1 MINOR: docs typo in '--zookeeper myhost:2181--execute'
this PR will fix a typo related to docs:
http://kafka.apache.org/21/documentation.html#rep-throttle

```bash
$ bin/kafka-reassign-partitions.sh --zookeeper myhost:2181--execute --reassignment-json-file bigger-cluster.json —throttle 50000000
```

I think `myhost:2181` should be `localhost:2181` and followed by a `space`

Author: opera443399 <pc@pcswo.com>

Reviewers: Gwen Shapira

Closes #6704 from opera443399/docs-ops-typo
2019-05-09 22:16:13 -07:00
Chris Egerton 7a4618a793 MINOR: Remove header and key/value converter config value logging (#6660)
The debug log lines in the `Plugins` class that log header and key/value converter configurations should be altered as the configurations for these converters may contain secrets that should not be logged in plaintext. Instead, only the keys for these configs are safe to expose.

Author: Chris Egerton <cegerton@oberlin.edu>
Reviewer: Randall Hauch <rhauch@gmail.com>
2019-05-09 20:35:08 -05:00
Chris Egerton 36a5aba4ec KAFKA-8231: Expansion of ConnectClusterState interface (#6584)
Expand ConnectClusterState interface and implementation with methods that provide the immutable cluster details and the connector configuration. This includes unit tests for the new methods.

Author: Chris Egerton <cegerton@oberlin.edu>
Reviews: Arjun Satish <arjun@confluent.io>, Konstantine Karantasis <konstantine@confluent.io>, Randall Hauch <rhauch@gmail.com>
2019-05-09 20:27:59 -05:00
A. Sophie Blee-Goldman b2826c6c2b KAFKA-8324: Add close() method to RocksDBConfigSetter (#6697)
Following KIP-453, this PR adds a default close() method to the RocksDBConfigSetter interface and calls it when closing a store.

Guozhang Wang <wangguoz@gmail.com>, Matthias J. Sax <mjsax@apache.org>,  John Roesler <john@confluent.io>, Bruno Cadonna <bruno@confluent.io>
2019-05-09 18:45:22 -04:00
Manikumar Reddy 5a8d74e151 KAFKA-6789; Handle retriable group errors in AdminClient API (#5578)
This patch adds support to retry all group operations after COORDINATOR_LOAD_IN_PROGRESS and COORDINATOR_NOT_AVAILABLE in AdminClient group operations. Previously we only had logic to retry after FindCoordinator failures.

Reviewers: Yishun Guan <gyishun@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jason Gustafson <jason@confluent.io>
2019-05-09 15:31:10 -07:00
Bob Barrett a97e55b838 KAFKA-8332: Refactor ImplicitLinkedHashSet to avoid losing ordering when converting to Scala
Because of how conversions between Java collections and Scala collections work, ImplicitLinkedHashMultiSet objects were being treated as unordered in some contexts where they shouldn't be.  This broke JOIN_GROUP handling.  

This patch renames ImplicitLinkedHashMultiSet to ImplicitLinkedHashMultCollection.  The order of Collection objects will be preserved when converting to scala.  Adding Set and List "views" to the Collection gives us a more elegant way of accessing that functionality when needed.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2019-05-09 11:08:22 -07:00
Matthias J. Sax 53dec548b6
MINOR: improve JavaDocs for KStream.through() (#6639)
Reviewers: Bruno Cadonna <bruno@confluent.io>, John Roesler <john@confluent.io>, A. Sophie Blee-Goldman <sophie@confluent.io>, Bill Bejeck <bill@confluent.io>
2019-05-09 15:45:50 +02:00
Ismael Juma c09e25fac2
MINOR: Fix bug in Struct.equals and use Objects.equals/Long.hashCode (#6680)
* Fixed bug in Struct.equals where we returned prematurely and added tests
* Update RequestResponseTest to check that `equals` and `hashCode` of
the struct is the same after serialization/deserialization only when possible.
* Use `Objects.equals` and `Long.hashCode` to simplify code
* Removed deprecated usages of `JUnitTestSuite`

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-05-09 06:21:24 -07:00
Joyce Fee cc4a7f01e8 MINOR: cleanup policy doc update (#6692)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2019-05-08 18:38:28 -07:00
Dhruvil Shah e6cff21fd8 KAFKA-7320; Add consumer configuration to disable auto topic creation [KIP-361] (#5542)
Implements KIP-361 to provide a consumer configuration to specify whether subscribing or assigning a non-existent topic would result in it being automatically created or not.

Reviewers: Jason Gustafson <jason@confluent.io>
2019-05-08 09:31:05 -07:00
cadonna 83823aedf2 BUGFIX: Add missing recording of close of stand-by task (#6663)
Adds recording of close of a stand-by task to the task-closed metric
Adds unit tests to verify the recording

Reviewers: Guozhang Wang <wangguoz@gmail.com>, John Roesler <john@confluent.io>
2019-05-08 11:26:25 -04:00
Colin Patrick McCabe 5144660040
KAFKA-8158: Add EntityType for Kafka RPC fields (#6503)
Reviewers: Jason Gustafson <jason@confluent.io>
2019-05-07 21:35:17 -07:00
Lucas Bradstreet 8308829e46 MINOR: correctly parse version OffsetCommitResponse version < 3
KAFKA-7903: automatically generate OffsetCommitRequest (#6583) introduced a change that cause consumer breakage when OffsetCommitResponse versions < 3 are parsed, as they do not include a throttle_time_ms field. This PR fixes the parsing by supplying the correct version to the OffsetCommitResponse constructor in AbstractResponse.parseResponse.

I have tested this change against many of the compatibility system tests, and it has fixed all the failures that I have tested thus far.

Author: Lucas Bradstreet <lucas@confluent.io>

Reviewers: Gwen Shapira, Boyang Chen

Closes #6698 from lbradstreet/offset-commit-response-throttle-field
2019-05-07 20:25:37 -07:00
Boyang Chen b0e82a68b3 KAFKA-8284: enable static membership on KStream (#6673)
Part of KIP-345 effort. The strategy is to extract user passed in group.instance.id config and pass it in with given thread-id (because consumer is currently per-thread level).

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2019-05-07 17:43:13 -07:00
Chris Egerton cc097e909c KAFKA-8304: Fix registration of Connect REST extensions (#6651)
Fix registration of Connect REST extensions to prevent deadlocks when extensions get the list of connectors before the herder is available. Added integration test to check the behavior.

Author: Chris Egerton <cegerton@oberlin.edu>
Reviewers: Arjun Satish <arjun@confluent.io>, Randall Hauch <rhauch@gmail.com>
2019-05-07 17:20:51 -05:00
Jason Gustafson 889512202c
KAFKA-8275; Take throttling into account when choosing least loaded node (#6619)
If a node is currently throttled, we should take it out of the running for `leastLoadedNode`. Additionally, current logic seems to favor connecting to new nodes rather than using existing connections which have one or more in flight requests. The javadoc is slightly vague about whether this is expected, but it seems not.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
2019-05-07 13:13:19 -07:00
Matthias J. Sax a6d5efaf0d KAFKA-3522: Interactive Queries must return timestamped stores (#6661)
Reviewers: John Roesler <john@confluent.io>,  Bill Bejeck <bbejeck@gmail.com>
2019-05-07 13:49:31 -04:00
Lucas Bradstreet 8e7b57fbcd MINOR: MetricsIntegrationTest should set StreamsConfig.STATE_DIR_CONFIG (#6687)
Reviewers: John Roesler <john@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-05-07 08:54:32 -07:00
Lee Dongjin 4eadaff6b2 MINOR: Remove unused field in `ListenerConnectionQuota`
Reviewers: Jason Gustafson <jason@confluent.io>
2019-05-07 08:36:59 -07:00
Sönke Liebau 2bf153f6a7 KAFKA-8131; Move --version implementation into CommandLineUtils (#6481)
This patch refactors the implementation of the --version option and moves it into the default command options. This has the benefit of automatically including it in the usage output of the command line tools. Several tools had to be manually updated because they did not use the common options.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Jason Gustafson <jason@confluent.io>
2019-05-07 08:26:24 -07:00
Mickael Maison 407bcdf78e KAFKA-8056; Use automatic RPC generation for FindCoordinator (#6408)
Reviewers: Jason Gustafson <jason@confluent.io>
2019-05-06 14:26:22 -07:00
Ismael Juma 90043d5f7e
MINOR: Remove workarounds for lz4-java bug affecting byte buffers (#6679)
lz4/lz4-java#65 was included in lz4-java 1.4.0.

Relying on existing tests for verification.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-05-06 06:53:49 -07:00
Fangbin Sun 0c62f5e664 KAFKA-7455: Support JmxTool to connect to a secured RMI port. (#5968)
Reviewers: Attila Sasvari <asasvari@apache.org>, Manikumar Reddy <manikumar.reddy@gmail.com>
2019-05-06 17:52:53 +05:30
Lifei Chen 3322439d98 MINOR: Document improvement (#6682)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-05-06 16:52:23 +05:30
huxi aaf2345386 MINOR: Fix ThrottledReplicaListValidator doc error. (#6537)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-05-06 16:07:30 +05:30
Dhruvil Shah 56b92a5504 KAFKA-8306; Initialize log end offset accurately when start offset is non-zero (#6652)
This patch ensures that the log end offset of each partition is initialized consistently with the checkpointed log start offset.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
2019-05-04 14:08:16 -07:00
A. Sophie Blee-Goldman c85152f5b9 Should close filter in RocksDBStoreTest as well (#6676)
Forgot to also close the filter in RocksDBStoreTest in time.

Reviewers: Bill Bejeck <bbejeck@gmail.com>
2019-05-04 10:52:53 -04:00
A. Sophie Blee-Goldman 14314e3d68 [HOT FIX] in-memory store behavior should match rocksDB (#6657)
While working on consolidating the various store unit tests I uncovered some minor "bugs" in the in-memory stores (inconsistencies with the behavior as established by the RocksDB stores).

open iterators should be properly closed in the case the store is closed
fetch/findSessions should always throw NPE if key is null
window end time should be truncated at Long.MAX_VALUE rather than throw exception
(Verified in-memory stores pass all applicable rocksDB tests now, unified unit tests coming in another PR)

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Bill Bejeck <bbejeck@gmail.com>
2019-05-04 10:44:18 -04:00
A. Sophie Blee-Goldman a1b1e088b9 KAFKA-8323: Close RocksDBStore's BloomFilter (#6672)
Any RocksJava object that inherits from org.rocksdb.AbstractNativeReference must be closed explicitly in order to free up the memory of the backing C++ object. The BloomFilter extends RocksObject (which implements AbstractNativeReference) and should be also be closed in RocksDBStore#close to avoid leaking memory.

Reviewers: Bill Bejeck <bbejeck@gmail.com>
2019-05-03 19:50:18 -04:00
Ismael Juma a37282415e
MINOR: Upgrade dependencies for Kafka 2.3 (#6665)
Many patch and minor updates.

Scalatest and Jetty deprecated classes that we
use. I removed usages for the former and filed KAFKA-8316 for the latter (I
suppressed the relevant deprecation warnings until the JIRA is fixed). As
part of the scalatest fixes, I also removed `TestUtils.fail` since it duplicates
`Assertions.fail`.

I also fixed a few compiler warnings that have crept in since my last sweep.

Updates of note:
- Jetty: 9.4.14 -> 9.4.18
  * https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.15.v20190215
  * https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.16.v20190411
  * https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.17.v20190418
  * https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.17.v20190418
  * https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.18.v20190429
- zstd: 1.3.8-1 -> 1.4.0-1
  * https://github.com/facebook/zstd/releases/tag/v1.4.0
  * zstd's fastest strategy, 6-8% faster in most scenarios
- zookeeper: 3.4.13 -> 3.4.14
  * https://zookeeper.apache.org/doc/r3.4.14/releasenotes.html

### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation 
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-05-03 10:35:07 -07:00
Matthias J. Sax 6d3ff132b5 KAFKA-8240: Fix NPE in Source.equals() (#6589)
Reviewers: John Roesler <john@confluent.io>, Bruno Cadonna <bruno@confluent.io>, Bill Bejeck <bbejeck@gmail.com>
2019-05-03 10:32:34 -04:00
Jason Gustafson 3ba4686d4d
KAFKA-7601; Clear leader epoch cache on downgraded format in append (#6568)
During a partial message format upgrade, it is possible for the message format to flap between new and old versions. If we detect that data appended to the log is on an old format, we can clear the leader epoch cache so that we revert to truncation by high watermark. Once the upgrade completes and all replicas are on the same format, we will append to the epoch cache as usual. Note this is related to KAFKA-7897, which handles message format downgrades through configuration. 

Reviewers: Jun Rao <junrao@gmail.com>
2019-05-02 17:46:01 -07:00
John Roesler eab855541a KAFKA-8289: Fix Session Expiration and Suppression (#6654)
Fix two problems in Streams:

* Session windows expired prematurely (off-by-one error), since the window end is inclusive, unlike other windows
* Suppress duration for sessions incorrectly waited only the grace period, but session windows aren't closed until gracePeriod + sessionGap

Update the tests accordingly

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Boyang Chen <boyang@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-05-02 17:44:53 -07:00
Boyang Chen a4f7675db1 KAFKA-8285: enable localized thread IDs in Kafka Streams (#6632)
Details in the JIRA: https://issues.apache.org/jira/browse/KAFKA-8285

Basically we want to avoid sharing of atomic updates for thread id with multiple stream instances on one JVM.

Reviewers: Raoul de Haard, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-05-02 17:16:17 -07:00
saisandeep b074173ea2 KAFKA-8191: Add pluggability of KeyManager to generate the broker Private Keys and Certificates
Reviewers: Sriharsha Chintalapani <sriharsha@apache.org>, Ismael Juma <ismael@juma.me.uk>
2019-05-02 15:11:42 -07:00
Jason Gustafson c34330c548
KAFKA-8248; Ensure time updated before sending transactional request (#6613)
This patch fixes a bug in the sending of transactional requests. We need to call `KafkaClient.send` with an updated current time. Failing to do so can result in an `IllegalStateExcepton` which leaves the producer effectively dead since the in-flight correlation id has been set, but no request has been sent. To avoid the same problem in the future, we update the in flight correlationId only after sending the request.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Apurva Mehta <apurva@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-05-02 09:29:22 -07:00
Dejan Stojadinović 093a22536f MINOR: Extract Gradle and its plugins versions into dependencies.gradle (#6648)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2019-05-01 19:20:12 -07:00
Zhanxiang (Patrick) Huang 6ca899e56d KAFKA-8066; Always close the sensors in Selector.close() (#6402)
When shutting down the ReplicaFetcher thread, we may fail to unregister sensors in selector.close(). When that happened, we will fail to start up the ReplicaFetcherThread with the same fetch id again because of the IllegalArgumentException in sensor registration. This issue will cause constant URPs in the cluster because the ReplicaFetchterThread is gone.

This patch addresses this issue by introducing a try-finally block in selector.close() so that we will always unregister the sensors in shutting down ReplicaFetcherThreads.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io>
2019-05-01 12:40:48 -07:00
Bill Bejeck ba1fc21864
KAFKA-8298: Fix possible concurrent modification exception (#6643)
When processing multiple key-changing operations during the optimization phase a ConcurrentModificationException is possible.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2019-05-01 12:07:45 -04:00
Stanislav Kozlovski 191f2faae0 KAFKA-7992: Introduce start-time-ms metric (#6318)
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Ismael Juma <ismael@juma.me.uk>
2019-05-01 08:58:02 -07:00
Matthias J. Sax 56c64803fa
KAFKA-3729: Revert adding Serde auto-config (#6630)
* Revert "MINOR: Add unit test for SerDe auto-configuration (#6610)"

This reverts commit 172fbb2dd5.

* Revert "[KAFKA-3729] Auto-configure non-default SerDes passed alongside the topology builder (#6461)"

This reverts commit e56ebbffca.

The two merged PRs introduce a breaking change. Reverting to preserve backward compatibility. Jira ticket reopened.

Reviewers: Ted Yu <yuzhihong@gmail.com>, Guozhang Wang <guozhang@confluent.io>
2019-05-01 09:33:53 +02:00
Matthias J. Sax c5665e6945
KAFAK-3522: add API to create timestamped stores (#6601)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Bruno Cadonna <bruno@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-05-01 09:28:10 +02:00
Chase Walden 626fbc60dd MINOR: Fix Embedded ConfigDef Validator toString issue (#6339)
`ConfigDef.embeddedValidator` should return an Anonymous Object instead of lambda so that we can have a useful `toString()` for methods such as `toRst`.

Reviewers: Jason Gustafson <jason@confluent.io>
2019-04-29 12:55:29 -07:00
Dhruvil Shah b4532a65f7 KAFKA-8134: `linger.ms` must be a long
Reviewers: Ismael Juma <ismael@juma.me.uk>, Colin P. McCabe <cmccabe@apache.org>
2019-04-29 08:59:17 -07:00
huxi 3af3f425c6 KAFKA-7779; Avoid unnecessary loop iteration in leastLoadedNode (#6081)
In NetworkClient.leastLoadedNode, we invoke `isReady` to  check if an established connection exists for the given node. `isReady` checks whether metadata needs to be updated also which wants to make metadata request first priority. However, if the to-be-sent request is metadata request, then we do not have to check this otherwise the loop in `leastLoadedNode` will do a complete iteration until the final node is selected. 

Reviewers: Jason Gustafson <jason@confluent.io>
2019-04-29 07:53:24 -07:00
Dejan Stojadinović df0adbcc2c MINOR: Update Gradle to 5.4.1 and update its plugins (#6436)
Details:
 * gradle: 5.1.1  -->  5.4.1
 * grgit: 1.9.3  -->  3.1.1 (breaking change release: artifact name is changed;
also, Grgit.open' usage is slightly refactored)
 * gradle-versions-plugin: 0.20.0 --> 0.21.0
 * shadow: 4.0.3  -->  4.0.4
 * spotless-plugin-gradle: 3.17.0  --> 3.23.0
 * checkstyle: 8.10 --> 8.20
 * spotbugs: 3.1.8 --> 3.1.12
 * jacoco: 0.8.2 --> 0.8.3
2019-04-29 06:37:10 -07:00
John Roesler 39400c46ac MINOR: improve Session expiration notice (#6618)
Reviewers: Matthias J. Sax <matthias@confluent.io>, A. Sophie Blee-Goldman <sophie@confluent.io>
2019-04-27 14:59:54 -07:00
A. Sophie Blee-Goldman 8299f2a397 KAFKA-8029: In memory session store (#6525)
First pass at an in-memory session store implementation.

Reviewers: Simon Geisler, Damian Guy <damian@confluent.io>, John Roesler <john@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-04-26 13:22:35 -07:00
A. Sophie Blee-Goldman dc31fea8bc MINOR: In-memory stores cleanup (#6595)
While going through the review of InMemorySessionStore I realized there is also some minor cleanup to be done for the other in-memory stores. This includes trivial changes such as removing unnecessary references to 'this' and moving collection initialization to the declaration. It also fixes some unsafe behavior (registering an iterator from inside its own constructor). In-memory window store iterator classes were made static and some instances of KeyValueIterator missing types were fixed across a handful of tests.

Reviewers: Guozhang Wang <wangguoz@gmail.com>,  Bruno Cadonna <bruno@confluent.io>
2019-04-26 11:50:34 -07:00