Commit Graph

5799 Commits

Author SHA1 Message Date
Stanislav Kozlovski fb0db7602a KAFKA-7844: Use regular subproject for generator to fix *All targets (#6182)
The presence of the buildSrc subproject is causing problems when we try
to run installAll, jarAll, and the other "all" targets. It's easier
just to make the generator code a regular subproject and use the
JavaExec gradle task to run the code. This also makes it more
straightforward to run the generator unit tests.

Reviewers: David Arthur <mumrah@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Co-authored-by: Colin P. Mccabe <cmccabe@confluent.io>
Co-authored-by: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>
2019-01-21 21:06:37 -08:00
Lee Dongjin 07d2cf2fdb Fix Documentation for cleanup.policy is out of date (#6181) 2019-01-21 10:04:22 -08:00
Matthias J. Sax 913e87ac53
MINOR: increase timeouts for KafkaStreamsTest (#6178)
Reviewer: Arjun Satish <arjun@confluent.io>
2019-01-21 00:15:57 -08:00
ryannatesmith e75e4732c9 MINOR: Rejoin split ssl principal mapping rules (#6099)
* Join ssl principal mapping rules correctly before evaluating.

Java properties splits the configuration array on commas, and that leads to rules containing commas being split before being evaluated. This commit adds a code change to re-join those strings into full rules before evaluating them. The function assumes every rule is either DEFAULT or begins with the prefix RULE:
2019-01-21 12:01:36 +05:30
Arjun Satish dc935c4beb MINOR: Handle case where connector status endpoints returns 404 (#6176)
Reviewers: Randall Hauch <randall@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2019-01-20 19:31:20 -08:00
Lee Dongjin e87e3f2cb2 MINOR: Remove unused imports, exceptions, and values (#6117)
1. Remove unthrown exceptions from MemoryRecordsBuilderTest
2. Remove unused imports from ReplicaFetcherThread, ZooKeeperClient, ApiVersionTest, PartitionTest
3. Remove unused value from PartitionTest
2019-01-20 13:25:35 -08:00
Matthias J. Sax ed7b67dd11
KAFKA-3522: Add internal RecordConverter interface (#6150)
Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-01-19 22:54:26 -08:00
Lars Francke 6cae2577ba Fix Javadoc of KafkaConsumer (#6155)
The Javadoc is using Properties.put which should never be used because it allows putting non-strings into a Properties object which is designed to only handle strings.
Two other minor fixes so the examples actually work
2019-01-19 13:14:50 -08:00
Matthias J. Sax e19eb3e290
KAFKA-6455: Extend CacheFlushListener to forward timestamp (#6147)
Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-01-19 09:39:57 -08:00
Jacek Laskowski 59f22521c0 MINOR: Log partition info when creating new request batch in controller (#6145)
Due to the missing `$`, the name was being logged instead of the value.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2019-01-18 20:54:57 -08:00
Guozhang Wang 56139df844
KAFKA-7652: Part I; Fix SessionStore's findSession(single-key) (#6134)
Let findSessions(final K key) to call on underlying bytes store directly, using the more restricted range.

Fix the conservative upper range for multi-key range in session schema.

Minor: removed unnecessary private WrappedSessionStoreBytesIterator class as it is only used in unit test.

Minor: removed unnecessary schema#init function by using the direct bytes-to-binary function.

Please read the original PR for more detailed explanation of the root cause of the bug.


Reviewers: Bill Bejeck <bill@confluent.io>, Damian Guy <damian@confluent.io>, John Roesler <john@confluent.io>
2019-01-18 12:08:14 -08:00
Guozhang Wang e1652de119
MINOR: Remove the InvalidTopicException handling in InternalTopicManager (#6167)
Note we can only remove this handling in 2.2 but not in 2.1 since #6124 is only in 2.2.

Reviewers: Bill Bejeck <bill@confluent.io>, Damian Guy <damian@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2019-01-18 11:36:55 -08:00
Richard Yu 78076f9b2a [KAFKA-7024] Rocksdb state directory should be created before opening the DB (#6138)
In RocksDBStore.openDB we call

Files.createDirectories(dir.getParentFile().toPath()); 
return RocksDB.open(options, dir.getAbsolutePath());

We would also add the absolute file path as well to avoid the extra logging.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-01-18 09:34:56 -08:00
Jingguo Yao 1221a34815 MINOR:: Fix typos (#6079)
1. Use singular form instead of plural form
2. Add a missing period
2019-01-18 00:47:10 -08:00
Dhruvil Shah 4b54eb4621 MINOR: log when controller begins processing logdir failure event (#6153)
Reviewers: Jun Rao <junrao@gmail.com>
2019-01-17 18:30:54 -08:00
Dong Lin 6a7eebe891 KAFKA-7829; Javadoc should show that AdminClient.alterReplicaLogDirs() is supported in Kafka 1.1.0 or later (#6157)
Reviewers: Jun Rao <junrao@gmail.com>
2019-01-17 15:30:16 -08:00
David Arthur 2c44e77e2f KAFKA-7738; Track leader epochs in client Metadata (#6045)
Track the last seen partition epoch in the Metadata class. When handling metadata updates, check that the partition info being received is for the last seen epoch or a newer one. This prevents stale metadata from being loaded into the client.

Reviewers: Jason Gustafson <jason@confluent.io>
2019-01-17 10:14:41 -08:00
Magesh Nandakumar dec68c9350 MINOR: Start Connect REST server in standalone mode to match distributed mode (KAFKA-7503 follow-up)
Start the Rest server in the standalone mode similar to how it's done for distributed mode.

Author: Magesh Nandakumar <magesh.n.kumar@gmail.com>

Reviewers: Arjun Satish <arjun@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #6148 from mageshn/KAFKA-7826
2019-01-16 22:58:30 -08:00
Boyang Chen 9a9310d074 KAFKA-7824; Require member.id for initial join group request [KIP-394] (#6058)
This patch implements KIP-394 as documented in https://cwiki.apache.org/confluence/display/KAFKA/KIP-394%3A+Require+member.id+for+initial+join+group+request.

Reviewers: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>, Jason Gustafson <jason@confluent.io>
2019-01-15 13:26:04 -08:00
Stanislav Kozlovski 2e53fa08af KAFKA-7792: Add simple /agent/uptime and /coordinator/uptime health check endpoints (#6130)
Reviewed-by: Colin P. McCabe <cmccabe@apache.org>
2019-01-15 11:52:48 -08:00
Guozhang Wang 68a6a7ae29
MINOR: Streams upgrade guide section for newly merged KIPs (#6108)
Reviewers: Bill Bejeck <bbejeck@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2019-01-15 10:25:29 -08:00
Guozhang Wang 3dffd5df2f
MINOR: Add log entry for KafkaException in StreamThread#runLoop (#6144)
I've observed several reports of sudden unexpected streamthread shutdown with the log entry like:

State transition from PENDING_SHUTDOWN to DEAD

but there is no related error logs before this line at all. I suspect this is because we intentionally do not log for KafkaException and there's some edge cases where we miss internally and hence caused this. I'm adding the ERROR level log entry here in order to reveal more information in case I saw this again in the future.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2019-01-15 10:19:03 -08:00
Chia-Ping Tsai af634a4a98 KAFKA-7391; Introduce close(Duration) to Producer and AdminClient instead of close(long, TimeUnit) (#5667)
See KIP-367: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=89070496.

Reviewers: Viktor Somogyi <viktorsomogyi@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Jason Gustafson <jason@confluent.io>
2019-01-15 08:48:32 -08:00
Stanislav Kozlovski 13f679013a MINOR: Update Trogdor StringExpander regex to handle an epilogue (#6123)
Update the Trogdor StringExpander regex to handle an epilogue.  Previously the regex would use a lazy quantifier at the end, which meant it would not catch anything after the range expression.  Add a unit test.

Reviewed-by: Colin P. McCabe <cmccabe@apache.org>
2019-01-14 20:49:24 -08:00
Andrew Schofield aca52b6d2c KAFKA-7461: Add tests for logical types
Added testing of logical types for Kafka Connect in support of KIP-145 features.
Added tests for Boolean, Time, Date and Timestamp, including the valid conversions.

The area of ISO8601 strings is a bit of a mess because the tokenizer is not compatible with
that format, and a subsequent JIRA will be needed to fix that.

A few small fixes as well as creating test cases, but they're clearly just corrections such as
using 0 to mean January (java.util.Calendar uses zero-based month numbers).

Author: Andrew Schofield <andrew_schofield@uk.ibm.com>

Reviewers: Mickael Maison <mimaison@users.noreply.github.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #6077 from AndrewJSchofield/KAFKA-7461-ConverterValuesLogicalTypesTest
2019-01-14 15:41:23 -08:00
Tom Bentley d8f126d70a Fix KAFKA-7789 by increasing the key size for the RSA keys generated for (#6096)
Reviewers: Jun Rao <junrao@gmail.com>
2019-01-14 14:00:30 -08:00
Arjun Satish 69d8d2ea11 KAFKA-7503: Connect integration test harness
Expose a programmatic way to bring up a Kafka and Zk cluster through Java API to facilitate integration tests for framework level changes in Kafka Connect. The Kafka classes would be similar to KafkaEmbedded in streams. The new classes would reuse the kafka.server.KafkaServer classes from :core, and provide a simple interface to bring up brokers in integration tests.

Signed-off-by: Arjun Satish <arjunconfluent.io>

Author: Arjun Satish <arjun@confluent.io>
Author: Arjun Satish <wicknicks@users.noreply.github.com>

Reviewers: Randall Hauch <rhauch@gmail.com>, Konstantine Karantasis <konstantine@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #5516 from wicknicks/connect-integration-test
2019-01-14 13:50:23 -08:00
Matthias J. Sax 82d1db6358
MINOR: code cleanup (#6054)
Reviewers: Bill Bejeck <bill@confluent.io>, John Roesler <john@confluent.io>, Guozhang Wang <guozhang@confluent.io>, Ryanne Dolan <ryannedolan@gmail.com>, Ismael Juma <ismael@confuent.io>
2019-01-14 13:36:36 -08:00
Attila Sasvari 0206e6c306 MINOR: Fix typo in security.html (#6141)
kafka-delegation-tokens.sh is the name of the script
2019-01-14 21:34:25 +05:30
Ismael Juma 12947f4f94 HOTFIX: Fix Properties.putAll compiler error when compiling with Java 11 (#6140) 2019-01-14 12:24:26 +00:00
Bill Bejeck eb61410a00 MINOR: Put state args in correct order named repartition test (#6114)
Another system test that needs to be updated with states in the correct order

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2019-01-13 16:57:08 -08:00
John Roesler f3ab1e5b9e MINOR: clarify the record selection algorithm and stream-time definition (#6128)
The existing javadoc for PartitionGroup is a little confusing.
It's relatively important for these concepts to be clear, since
they form the basis for stream-time in Kafka Streams.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-01-13 11:43:48 -08:00
Mayuresh Gharat 8afce0e338 KAFKA-4453 : Added code to separate controller connections and requests from the data plane (#5921)
KIP-291 Implementation : Added code to separate controller connections and requests from the data plane.

Tested with local deployment that the controller request are handled by the control plane and other requests are handled by the data plane.
Also added unit tests in order to test the functionality.

Author: Lucas Wang <luwang@linkedin.com>, 
Author: Mayuresh Gharat <gharatmayuresh15@gmail.com>

Reviewers: Joel Koshy <jjkoshy@gmail.com>, Jun Rao <junrao@gmail.com>
2019-01-13 10:17:52 -08:00
Kamal Chandraprakash cb3eedcf94 KAFKA-7781; Add validation check for retention.ms topic property.
Using AdminClient#alterConfigs, topic `retention.ms` property can be assigned to a value lesser than -1. This leads to inconsistency while describing the topic configuration. We should not allow values lesser than -1.

Author: Kamal Chandraprakash <kamal.chandraprakash@gmail.com>

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>,Matthias J. Sax <matthias@confluent.io>

Closes #6082 from kamalcph/KAFKA-7781
2019-01-13 18:44:29 +05:30
Colin Patrick McCabe 71e85f5e84 KAFKA-7609; Add Protocol Generator for Kafka (#5893)
This patch adds a framework to automatically generate the request/response classes for Kafka's protocol. The code will be updated to use the generated classes in follow-up patches. Below is a brief summary of the included components:

**buildSrc/src**
The message generator code is here.  This code is automatically re-run by gradle when one of the schema files changes.  The entire directory is processed at once to minimize the number of times we have to start a new JVM.  We use Jackson to translate the JSON files into Java objects.

**clients/src/main/java/org/apache/kafka/common/protocol/Message.java**
This is the interface implemented by all automatically generated messages.

**clients/src/main/java/org/apache/kafka/common/protocol/MessageUtil.java**
Some utility functions used by the generated message code.

**clients/src/main/java/org/apache/kafka/common/protocol/Readable.java, Writable.java, ByteBufferAccessor.java**
The generated message code uses these classes for writing to a buffer.

**clients/src/main/message/README.md**
This README file explains how the JSON schemas work.

**clients/src/main/message/\*.json**
The JSON files in this directory implement every supported version of every Kafka API.  The unit tests automatically validate that the generated schemas match the hand-written schemas in our code.  Additionally, there are some things like request and response headers that have schemas here.

**clients/src/main/java/org/apache/kafka/common/utils/ImplicitLinkedHashSet.java**
I added an optimization here for empty sets.  This is useful here because I want all messages to start with empty sets by default prior to being loaded with data.  This is similar to the "empty list" optimizations in the `java.util.ArrayList` class.

Reviewers: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>, Ismael Juma <ismael@juma.me.uk>, Bob Barrett <bob.barrett@outlook.com>, Jason Gustafson <jason@confluent.io>
2019-01-11 16:40:21 -08:00
Xi Yang cc33511e9a MINOR: Support choosing different JVMs when running integration tests
+ Add a parameter to the ducktap-ak to control the OpenJDK base image.
+ Fix a few issues of using OpenJDK:11 as the base image.

*More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.*

*Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.*

Author: Xi Yang <xi@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #6071 from yangxi/ducktape-jdk
2019-01-11 15:11:55 -08:00
Lee Dongjin 7df3e8cd38 KAFKA-7808: AdminClient#describeTopics should not throw InvalidTopic if topic name is not found (#6124)
* Update KafkaAdminClient#describeTopics to throw UnknownTopicOrPartitionException.

* Remove unused method: WorkerUtils#getMatchingTopicPartitions.

* Add some JavaDoc.

Reviewed-by: Colin P. McCabe <cmccabe@apache.org>, Ryanne Dolan <ryannedolan@gmail.com>
2019-01-11 14:56:06 -08:00
Jason Gustafson e120feb485
HOTFIX: Compilation error in CommandLineUtils (#6131)
This was broken by #6084. The syntax works with Scala 2.12, but not 2.11.

Reviewers: Colin Patrick McCabe <colin@cmccabe.xyz>
2019-01-11 13:40:22 -08:00
Stanislav Kozlovski 625e0d8829 KAFKA-7790: Fix Bugs in Trogdor Task Expiration (#6103)
The Trogdor Coordinator now overwrites a task's startMs to the time it received it if startMs is in the past.

The Trogdor Agent now correctly expires a task after the expiry time (startMs + durationMs) passes. Previously, it would ignore startMs and expire after durationMs milliseconds of local start of the task.

Reviewed-by: Colin P. McCabe <cmccabe@apache.org>
2019-01-11 13:38:00 -08:00
Bill Bejeck 3746bf2c84 MINOR: Need to have same wait as verify timeout broker upgrade downgrade (#6127)
When I originally refactored the streams_upgrade_test#upgrade_downgrade_brokers test I removed the wait call which would wait for up 24 minutes for the SmokeTestDriver class to publish and verify all of its records.

Since most of the tests run in two minutes or less I set the monitor_log timeout to three minutes. However, the SmokeTestDriver#verify method allows up to six minutes to consume all records before verifying the monitor_log timeout needs to be greater than 6 minutes. I've set the timeout to 8 minutes.

Additionally, the steps needed to update the streams_upgrade_test should be documented as there are several components that need to get updated. So I've documented those steps here on the test as a giant comment.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2019-01-11 11:35:33 -08:00
Kan Li 694da1ac1e KAFKA-6627: Prevent config default values overriding ones specified through --producer-property on command line. (#6084)
* KAFKA-6627: Prevent config default values overriding ones specified through --producer-property on command line.

In Console{Producer,Consumer}, extraProducerProps (options specified in
--producer-property) is applied first, then overriden unconditionally,
even if the value is not specified explicitly (and default value is
used). This patch fixes it so that it doesn't override the existing
value set by --producer-property if it is not explicitly specified.

The contribution is my original work and I license the work to the
project under the project's open source license.

Reviewers: Sriharsha Chintalapani <sriharsha@apache.org>
2019-01-11 10:29:10 -08:00
John Roesler b4bf6232c2 KAFKA-7741: Streams exclude javax dependency (#6121)
As documented in https://issues.apache.org/jira/browse/KAFKA-7741,
the javax dependency we receive transitively from connect is incompatible
with SBT builds.

Streams doesn't use the portion of Connect that needs the dependency,
so we can fix the builds by simply excluding it.

Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-01-10 15:50:52 -08:00
Bill Bejeck c238af29bf MINOR: Remove throwing exception if not found from describe topics (#6112)
We recently improved the handling of the InternalTopicManager retries with #6085. The AdminClient will throw an InvalidTopicException if the topic is not found. We need to ignore that exception as when calling AdminClient#describe we may not have had a chance to create the topic yet, especially with the case of internal topics

I've created a new test asserting that when an InvalidTopicException is thrown when the topic is not found we continue on.

Reviewers: John Roesler <john@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-01-10 10:03:11 -08:00
Manikumar Reddy e8959bd766 KAFKA-5994; Log ClusterAuthorizationException for all ClusterAction requests
Author: Manikumar Reddy <manikumar.reddy@gmail.com>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #5021 from omkreddy/KAFKA-5994-CLUSTER-AUTH
2019-01-10 19:18:58 +05:30
Ismael Juma 4154eb9f11
MINOR: Update dependencies for Kafka 2.2 (#6116)
- Scala 2.12.7 -> 2.12.8
- Gradle 5.0 -> 5.1
- Jetty 9.4.12 -> 9.4.14
- Rat 0.12 -> 0.13
- Patch bumps for easymock, jackson, powermock
- Patch bumps for gradle plugins: shadow, spotbugs, dependency-check, spotless

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-01-10 01:14:30 -08:00
Bill Bejeck b1b792d9a8 MINOR: Add 2.1 version metadata upgrade (#6111)
Updated the test_metadata_upgrade test. To enable using the 2.1 version I needed to add config change to the StreamsUpgradeTestJobRunnerService to ensure the ductape passes proper args when starting the StreamsUpgradeTest

For testing, I ran the test_metadata_upgrade test and all versions now pass http://confluent-kafka-branch-builder-system-test-results.s3-us-west-2.amazonaws.com/2019-01-09--001.1547049873--bbejeck--MINOR_add_2_1_version_metadata_upgrade--a450c68/report.html

Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-01-09 15:19:00 -08:00
Anna Povzner b2b79c4f0e KAFKA-7786; Ignore OffsetsForLeaderEpoch response if epoch changed while request in flight (#6101)
There is a race condition in ReplicaFetcherThread, where we can update PartitionFetchState with the new leader epoch (same leader) before handling the OffsetsForLeaderEpoch response with FENCED_LEADER_EPOCH error which causes removing partition from partitionStates, which in turn causes no fetching until the next LeaderAndIsr. 

This patch adds logic to ensure that the leader epoch doesn't change while an OffsetsForLeaderEpoch request is in flight (which could happen with back-to-back leader elections). If it has changed, we ignore the response.

Also added toString() implementation to PartitionData, because some log messages did not show useful info which I found while investigating the above system test failure.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
2019-01-09 11:09:48 -08:00
Stanislav Kozlovski 66a9416e38 MINOR: Log successful/failed authentications with socket information (#5856)
Use `info` for failed authentications and `debug` for successful ones.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Ismael Juma <ismael@juma.me.uk>
2019-01-09 09:32:02 -08:00
Matthias J. Sax 1c7bf4e497
MINOR: code cleanup (#6053)
Reviewers: Bill Bejeck <bill@confluent.io>, John Roesler <john@confluent.io>, Ryanne Dolan <ryannedolan@gmail.com>, Guozhang Wang <guozhang@confluent.io>
2019-01-09 18:03:16 +01:00
Matthias J. Sax 86de2dfd27
MINOR: code cleanup (#6057)
Reviewers: Bill Bejeck <bill@confluent.io>, John Roesler <john@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-01-09 15:04:52 +01:00