Commit Graph

4913 Commits

Author SHA1 Message Date
Rajini Sivaram 98bb75a58f
KAFKA-6772: Load credentials from ZK before accepting connections (#4867)
Start processing client connections only after completing KafkaServer initialization to ensure that credentials are loaded from ZK into cache before authentications are processed. Acceptors are started earlier so that bound port is known for registering in ZK.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Jun Rao <junrao@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2018-04-18 10:20:28 +01:00
Matthias J. Sax cae42215b7
KAFKA-6054: Update Kafka Streams metadata to version 3 (#4880)
- adds Streams upgrade tests for 1.1 release
 - introduces metadata version 3

Reviewers: John Roesler <john@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2018-04-18 09:38:27 +02:00
Guozhang Wang 0e0fd4fe8d
HOTFIX: use the new prop object (#4888) 2018-04-17 17:53:39 -07:00
Andras Beni 52e9ba66a5 MINOR: Add line break so example command is readable without scrolling (#4879) 2018-04-17 16:37:34 -07:00
John Roesler ac9c3ed0b4 KAFKA-6376: preliminary cleanup (#4872)
General cleanup of Streams code, mostly resolving compiler warnings and re-formatting.

The regular testing suite should be sufficient.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2018-04-17 13:13:15 -07:00
Mickael Maison 83503404e4 KAFKA-6770; Add New Protocol Versions to 1.1.0 documentation (#4847)
Update 1.1 docs to include 2 new versions to existing APIs:
- DescribeConfigs v1
- Fetch v7

Also fix a typo in1 FetchRequest.
2018-04-17 13:07:08 -07:00
Valentino Proietti 01eddce01f KAFKA-6742: TopologyTestDriver error when dealing with stores from GlobalKTable
guozhangwang

While TopologyTestDriver works well with stores created from KTable it does not with stores from GlobalKTable.
Moreover, for my testing purposes but I think it can be useful to others, I need to get access to the MockProducer inside TopologyTestDriver.

I have added 4 new tests to TopologyTestDriverTest, two for stores from KTable and two for stores from GlobalKTable.

While I was changing the TopologyTestDriver I've also make it implement java.io.Closeable.

Author: Valentino Proietti <valentino.proietti@kydea.com>

Reviewers: Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>, John Roesler <john@confluent.io>, Guozhang Wang <wangguoz@gmail.com>

Closes #4823 from Vale68/KAFKA-6742

minor renaming
2018-04-17 09:40:58 -07:00
Rajini Sivaram e5de679d62
KAFKA-6765: Handle exception while reading throttle metric value in test (#4869)
Quota tests wait for throttle metric to be updated without waiting for requests to complete to avoid waiting for potentially large throttle times. This requires the test to read metric values while a broker may be updating the value, resulting in exception in the test. Since this issue can also occur with JMX metrics reporter, change synchronization on metrics with sensors to use the sensor as lock.
2018-04-17 14:46:28 +01:00
gitlw 341db990dc KAFKA-6650: Allowing transition to OfflineReplica state for replicas without leadership info (#4825)
A partially deleted topic can end up with some partitions having no leadership info.
For the partially deleted topic, a new controller should be able to finish the topic deletion
by transitioning the rogue partition's replicas to OfflineReplica state.
This patch adds logic to transition replicas to OfflineReplica state whose partitions have
no leadership info.

Added a new test method to cover the partially deleted topic case.

Reviewers: Jun Rao <junrao@gmail.com>
2018-04-16 17:16:08 -07:00
Chia-Ping Tsai 4013767d86 MINOR: Log the exception thrown by Selector.poll (#4873) 2018-04-16 13:43:54 -07:00
Andy Coates 432c82d3bf KAFKA-6727; Fix broken Config hashCode() and equals() (#4796)
Reviewers: Manikumar Reddy O <manikumar.reddy@gmail.com>, Guozhang Wang <wangguoz@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
2018-04-16 12:32:07 -07:00
ro7m b6f0420350 Kafka-6792: Fix wrong pointer in the link for stream dsl (#4876)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2018-04-16 10:49:41 -07:00
Allen Wang 19418fc86a KAFKA-6514; Add API version as a tag for the RequestsPerSec metric (#4506)
Updated `RequestChannel` to include `version` as a tag for all RequestsPerSec metrics (KIP-272). Updated tests to verify that the extra tag exists.
2018-04-16 10:16:26 -07:00
Ismael Juma f3ed56b21f MINOR: Mention that -1 disables retention by time (#4881)
Reviewers: Colin Patrick McCabe <colin@cmccabe.xyz>, Jason Gustafson <jason@confluent.io>
2018-04-16 09:53:08 -07:00
Colin Patrick McCabe 93e03414f7 KAFKA-6771. Make specifying partitions more flexible (#4850) 2018-04-16 08:55:13 +01:00
Colin Patrick McCabe 832b096f4f KAFKA-6696 Trogdor should support destroying tasks (#4759)
Implement destroying tasks and workers.  This means erasing all record of them on the Coordinator and the Agent.

Workers should be identified by unique 64-bit worker IDs, rather than by the names of the tasks they are implementing.  This ensures that when a task is destroyed and re-created with the same task ID, the old workers will be not be treated as part of the new task instance.

Fix some return results from RPCs.  In some cases RPCs were returning values that were never used.  Attempting to re-create the same task ID with different arguments should fail.  Add RequestConflictException to represent HTTP error code 409 (CONFLICT) for this scenario.

If only one worker in a task stops, don't stop all the other workers for that task, unless the worker that stopped had an error.

Reviewers: Anna Povzner <anna@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2018-04-16 08:51:33 +01:00
Guozhang Wang 9871357086
KAFKA-6592: Follow-up (#4864)
Do not require ConsoleConsumer to specify inner serde as s special property, but just a normal property of the message formatter.
2018-04-15 20:51:53 -07:00
Guozhang Wang 0dc7f0e66f
KAFKA-6611, PART II: Improve Streams SimpleBenchmark (#4854)
SimpleBenchmark:

1.a Do not rely on manual num.records / bytes collection on atomic integers.
1.b Rely on config files for num.threads, bootstrap.servers, etc.
1.c Add parameters for key skewness and value size.
1.d Refactor the tests for loading phase, adding tumbling-windowed count.
1.e For consumer / consumeproduce, collect metrics on consumer instead.
1.f Force stop the test after 3 minutes, this is based on empirical numbers of 10M records.

Other tests: use config for kafka bootstrap servers.

streams_simple_benchmark.py: only use scale 1 for system test, remove yahoo from benchmark tests.

Note that the JMX based metrics is more accurate than the manually collected metrics. 

Reviewers: John Roesler <john@confluent.io>, Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2018-04-15 10:15:31 -07:00
Guozhang Wang b599b395f3
KAFKA-6058: Refactor consumer API result return types (#4856)
Refactored the return types in consumer group APIs the following way:

```
Map<TopicPartition, KafkaFuture<Void>> DeleteConsumerGroupsResult#deletedGroups()

Map<TopicPartition, KafkaFuture<ConsumerGroupDescription>> DescribeConsumerGroupsResult#describedGroups()

KafkaFuture<Collection<ConsumerGroupListing>> ListConsumerGroupsResult#listings()

KafkaFuture<Map<TopicPartition, OffsetAndMetadata>> ListConsumerGroupOffsetsResult#partitionsToOffsetAndMetadata()
```

* For DeleteConsumerGroupsResult and DescribeConsumerGroupsResult, for each group id we have two round-trips to get the coordinator, and then send the delete / describe request; I leave the potential optimization of batching requests for future work.

* For ListConsumerGroupOffsetsResult, it is a simple single round-trip and hence the whole map is wrapped as a Future.

* ListConsumerGroupsResult, it is the most tricky one: we would only know how many futures we should wait for after the first listNode returns, and hence I constructed the flattened future in the middle wrapped with the underlying map of futures; also added an iterator API to compensate the "fail the whole future if any broker returns error" behavior. The iterator future will throw exception on the failing brokers, while return the consumer for other succeeded brokers.

Reviewers: Colin Patrick McCabe <colin@cmccabe.xyz>, Jason Gustafson <jason@confluent.io>
2018-04-15 10:13:22 -07:00
ro7m 8434d494e6 KAFKA-6790: Fix Streams processor node broken link (#4874)
The page here https://kafka.apache.org/11/documentation/streams/developer-guide/memory-mgmt.html talks about processor nodes and refers to non existing links.

Broken link (appears twice in the same document):

https://kafka.apache.org/11/documentation/streams/concepts.html#streams-concepts-processor

To find this search for the word "processor node" on the page memory-management , the ones which are links are broken.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2018-04-15 09:56:12 -07:00
Sönke Liebau 886daf5fca KAFKA-6234; Increased timeout value for lowWatermark response to fix transient failures (#4238)
Removed timeout from get call that caused the test to fail occasionally, this will instead fall back to the wrapping waitUntilTrue timeout. Also added unnesting of exceptions from ExecutionException that was originally missing and put the retrieved value for lowWatermark in the fail message for better readability in case of test failure.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
2018-04-12 15:45:38 -07:00
Jason Gustafson fb3a9485a8
MINOR: Disable failing testDescribeConsumerGroupOffsets test case (#4863)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2018-04-12 11:36:59 -07:00
huxi 4e35a2bfb7 KAFKA-6592: ConsoleConsumer should support WindowedSerdes (#4797)
Have Console consumer support TimeWindowedDeserializer/SessionWindowedDeserializer.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2018-04-12 09:35:37 -07:00
John Roesler cc43e77bbb MINOR: make Sensor#add idempotent (#4853)
This change makes adding a metric to a sensor idempotent.
That is, if the metric is already added to the sensor, the method
returns with success.

The current behavior is that any attempt to register a second metric
with the same name is an error.

Testing strategy: There is a new unit test covering this behavior

Reviewers: Guozhang Wang <guozhang@confluent.io>, Bill Bejeck <bill@confluent.io>
2018-04-11 20:50:10 -07:00
Jason Gustafson 7421f9dce2
KAFKA-6773; Allow offset commit/fetch/describe/delete with empty groupId (#4851)
We had a regression in #4788 which caused the offset commit/fetch/describe APIs to fail if the groupId was empty. This should be allowed for backwards compatibility. Additionally, I have modified DeleteGroups to allow removal of the empty group, which was missed in the initial implementation. I've added a test case to ensure that we do not miss this again in the future.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2018-04-11 16:47:11 -07:00
Colin Patrick McCabe e4d652befe MINOR: Fix AsyncProducerTest bug that hits when logging is turned up (#4450)
AsyncProducerTest gets an error about an incorrect mock when the logging
level is turned up.  Instead of usIng a mock, just create a real
SyncProducerConfig object, since the object is simple to create.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2018-04-11 14:50:11 -07:00
Jimin Hsieh 83a9e04c19 MINOR: Fix doc - `FileMessageSet` was replaced by `FileRecords` (#4852)
Reviewers: Manikumar Reddy O <manikumar.reddy@gmail.com>, Jason Gustafson <jason@confluent.io>
2018-04-11 14:27:04 -07:00
Jorge Quilcate Otoya 6a99da87ab KAFKA-6058: KIP-222; Add Consumer Group operations to Admin API
KIP: https://cwiki.apache.org/confluence/display/KAFKA/KIP-222+-+Add+Consumer+Group+operations+to+Admin+API

Author: Jorge Quilcate Otoya <quilcate.jorge@gmail.com>
Author: Jorge Esteban Quilcate Otoya <quilcate.jorge@gmail.com>
Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Colin Patrick McCabe <colin@cmccabe.xyz>, Guozhang Wang <wangguoz@gmail.com>

Closes #4454 from jeqo/feature/admin-client-describe-consumer-group
2018-04-11 14:17:46 -07:00
Manikumar Reddy O 47918f2d79 KAFKA-6447: Add Delegation Token Operations to KafkaAdminClient (KIP-249) (#4427)
Reviewers: Jun Rao <junrao@gmail.com>
2018-04-11 10:48:04 -07:00
Manikumar Reddy O e29fa9a4ca KAFKA-6752: Enable unclean leader election metric (#4838)
Reviewers: Jun Rao <junrao@gmail.com>
2018-04-11 10:30:30 -07:00
Colin Patrick McCabe 4223ef6106 MINOR: Add NullPayloadGenerator to Trogdor (#4844) 2018-04-10 20:48:38 +01:00
Manikumar Reddy O 5e277e5579 KAFKA-4883: handle NullPointerException while parsing login modue control flag (#4849) 2018-04-10 20:46:32 +01:00
Rajini Sivaram 79c6f7cd9a
MINOR: Move creation of quota callback to ensure single instance (#4848)
Move creation of quota callback instance out of KafkaConfig constructor to QuotaFactory.instantiate to avoid creating a callback instance for every KafkaConfig since we create temporary KafkaConfigs during dynamic config updates.

Reviewers: Jun Rao <junrao@gmail.com>
2018-04-10 20:42:07 +01:00
Magnus Edenhill e490a90625 Make [Config]Resource.toString() consistent with existing code (#4845)
The toString() for ConfigResource was using { } instead of ( ) which is inconsistent with the existing toStrings in the code, while toString for Resource was using a mix of ( and }.
2018-04-10 12:40:42 +01:00
Anna Povzner 989fe0497e Kafka-6693: Added consumer workload to Trogdor (#4775)
Added consumer only workload to Trogdor. The topics must already be pre-populated. The spec lets the user request topic pattern and range of partitions to assign to [startPartition, endPartition].

Reviewers: Colin P. Mccabe <cmccabe@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2018-04-10 09:45:08 +01:00
Jason Gustafson 0a8f35b684
KAFKA-6768; Transactional producer may hang in close with pending requests (#4842)
This patch fixes an edge case in producer shutdown which prevents `close()` from completing due to a pending request which will never be sent due to shutdown initiation. I have added a test case which reproduces the scenario.

Reviewers: Apurva Mehta <apurva@confluent.io>, Ismael Juma <ismael@juma.me.uk>
2018-04-09 15:39:07 -07:00
Ismael Juma e6b4d17c59
MINOR: Java 10 fixes so that the build passes (#4839)
* Upgrade EasyMock to 3.6 which adds support for Java 10
by upgrading to ASM 6.1.1.

* Ensure that Jacoco is truly disabled for the `core` project.
This was the original intent, since it's in Scala, but it had not
been achieved. This is important because the Jacoco agent
fails when it tries to instrument the classes compiled by
scalac with Java 10.
2018-04-09 03:34:36 -07:00
Benedict Jin 37efc79eb8 MINOR: Remove magic number and extract Pattern instance from method as class field (#4799)
* Remove magic number
* Extract Pattern instance from method as class field
* Add @Override declare

Reviewers: Randall Hauch <rhauch@gmail.com>
2018-04-08 11:54:22 -07:00
Colin Patrick McCabe 40183e3156 KAFKA-6688. The Trogdor coordinator should track task statuses (#4737)
Reviewers: Anna Povzner <anna@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2018-04-08 09:35:33 +01:00
Ismael Juma fedac0cea7 MINOR: Mention leader in a few follower/controller log messages (#4835) 2018-04-08 11:20:21 +08:00
Matthias J. Sax 0c0d8363e5
KAFKA-6054: Fix upgrade path from Kafka Streams v0.10.0 (#4779)
Reviewers: Guozhang Wang <guozhang@confluent.io>, Bill Bejeck <bill@confluent.io>, John Roesler <john@confluent.io>, Damian Guy <damian@confluent.io>
2018-04-06 17:00:52 -07:00
Rajini Sivaram 77ebd32016
KAFKA-6576: Configurable Quota Management (KIP-257) (#4699)
Enable quota calculation to be customized using a configurable callback. See KIP-257 for details.

Reviewers: Jun Rao <junrao@gmail.com>
2018-04-06 22:49:34 +01:00
Anna Povzner da32db9f34 Trogdor: Added commonClientConf and adminClientConf to workload specs (#4757)
Currently, WorkerUtils will be able to create topics when there is no security. To be able to work with secure kafka, WorkerUtils.createTopic() needs to be able to take security configs. This PR adds commonClientConf field to both producer bench and roundtrip workload specs so that users can specify security and other common configs once for producer/consumer and adminClient. Also added adminClientConf field to workload specs so that users can specify adminClient specific configs if they want to. For completeness, added consumerConf and producerConf to roundtrip workload spec.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Colin P. Mccabe <cmccabe@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2018-04-06 19:21:41 +01:00
tedyu ac542c9a83 KAFKA-6747 Check whether there is in-flight transaction before aborting transaction (#4826)
As Frederic reported on mailing list under the subject "kafka-streams Invalid transition attempted from state READY to state ABORTING_TRANSACTION", producer#abortTransaction should only be called when transactionInFlight is true.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2018-04-05 15:29:04 -07:00
fredfp 3abd410708 KAFKA-6748: double check before scheduling a new task after the punctuate call (#4827)
After the punctuate() call, we would like to double check on the scheduled flag since the call itself may cancel it.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, John Roesler <john@confluent.io>
2018-04-05 11:17:40 -07:00
Manikumar Reddy O ed2f10e050 MINOR: Update max.connections.per.ip.overrides config docs (#4819)
Add a validation check to make sure max.connections.per.ip.overrides is configured when max.connections.per.ip is set zero. Also clean up the config description.
2018-04-05 08:59:35 -07:00
Manikumar Reddy O 77c79df396 KAFKA-6741: Disable Selector's idle connection timeout in testNetworkThreadTimeRecorded() test (#4824)
Reviewers: Jason Gustafson <jason@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2018-04-05 14:56:27 +01:00
Colin Patrick McCabe 63642d6051 KAFKA-6694: The Trogdor Coordinator should support filtering task responses (#4741) 2018-04-05 13:35:20 +01:00
Rajini Sivaram 9f8c3167eb
KAFKA-4292: Configurable SASL callback handlers (KIP-86) (#2022)
Implementation of KIP-86. Client, server and login callback handlers have been made configurable for both brokers and clients.

Reviewers: Jun Rao <junrao@gmail.com>, Ron Dagostino <rndgstn@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
2018-04-05 09:41:42 +01:00
Chia-Ping Tsai 53d4267c59 MINOR: Don’t send the DeleteTopicsRequest for invalid topic names (#4763)
The invalid topic name is already handled locally so it is unnecessary to send the DeleteTopicsRequest. This PR adds a count to MockClient for testing.

Reviewers: Colin Patrick McCabe <colin@cmccabe.xyz>, Jason Gustafson <jason@confluent.io>
2018-04-05 00:06:14 -07:00