Commit Graph

7927 Commits

Author SHA1 Message Date
Ron Dagostino e8524ccd8f
KAFKA-10259: KIP-554 Broker-side SCRAM Config API (#9032)
Implement the KIP-554 API to create, describe, and alter SCRAM user configurations via the AdminClient.  Add ducktape tests, and modify JUnit tests to test and use the new API where appropriate.

Reviewers: Colin P. McCabe <cmccabe@apache.org>, Rajini Sivaram <rajinisivaram@googlemail.com>
2020-09-04 13:05:01 -07:00
Ning Zhang c6d135e21f
KAFKA-10133: MM2 readme update on config (#9215)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Ryanne Dolan <ryannedolan@gmail.com>
2020-09-04 19:26:23 +02:00
Noa Resare 23cade8506
KAFKA-10314: KafkaStorageException on reassignment when offline log directories exist (#9122)
Make sure that we set the isNew field in LeaderAndIsrRequest correctly for brokers
that gets added to the replica set on reassignment.

This is tested by creating a variant of ControllerIntergationTest.testPartitionReassignment()
that makes one of the log directories on the target broker offline before initiating the
reassignment. Without the change to the way isNew is set, this fails after a timeout. With
the change, it succeeds.

To facilitate calling causeLogDirFailure() both from ControllerIntegrationTest and
LogDirFailureTest, the method was moved to TestUtils along with the other helper
methods that deals with interacting with KafkaServer instances for test cases.

Reviewers: Mickael Maison <mickael.maison@gmail.com>
2020-09-04 17:34:31 +02:00
John Roesler 9c8501f5f0
MINOR: Record all poll invocations (#9234)
Record the pollSensor after every invocation to poll, rather than just when we get records back so that we can accurately gauge how often we're invoking Consumer#poll.

Reviewers: Bruno Cadonna <bruno@confluent.io>, Guozhang Wang <guozhang@apache.org>, Matthias J. Sax <mjsax@apache.org>
2020-09-03 14:18:45 -05:00
Bruno Cadonna 1e31354557
KAFKA-10355: Throw error when source topic was deleted (#9191)
Before this commit, Kafka Streams would gracefully shut down the whole application when a source topic is deleted. The graceful shutdown does not give the user the possibility to react on the deletion of the source topic in the uncaught exception handler.

This commit changes this behavior and throws an error when a source topic is deleted.

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Guozhang Wang <guozhang@apache.org>, John Roesler <vvcephei@apache.org>
2020-09-03 14:16:14 -05:00
Bruno Cadonna c04000cab1
KAFKA-9924: Add remaining property-based RocksDB metrics as described in KIP-607 (#9232)
This commit adds the remaining property-based RocksDB metrics as described in KIP-607, except for num-entries-active-mem-table, which was added in PR #9177.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2020-09-02 15:32:17 -07:00
leah 24b03a688f
MINOR: Fix message count for sliding windows test (#9248)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, John Roesler <vvcephei@apache.org>
2020-09-02 17:19:39 -05:00
Jorge Esteban Quilcate Otoya 4f06d9e7d0
KAFKA-9929: Support backward iterator on WindowStore (#9138)
Implements KIP-617 on WindowStore that depends on #9137.

Testing strategy: extend existing tests to validate reverse operations are supported.

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2020-09-02 15:17:07 -07:00
Yuriy Badalyantc 4662ed4aac
MINOR: Fix build scala 2.12 build after KAFKA-10020 (#9245)
Fixes a problem in which the Serdes class in the same package as
the tests (the old one) overshadows the one we explicitly imported
(the new one), but only in Scala 2.12. Since users (hopefully) don't
put their classes in our packages, they won't face the same problem.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>, John Roesler <vvcephei@apache.org>
2020-09-02 12:49:47 -05:00
Mickael Maison fd02c8f07f
MINOR: Include call name in TimeoutException (#8050)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-09-02 18:04:51 +02:00
Jesse Gorzinski 55c1ab62c9
KAFKA-10272: Add IBM i support to "stop" scripts (#9023)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2020-09-02 17:46:24 +02:00
Can Cecen 6e8a01e18c
KAFKA-10098: Remove unnecessary escaping in regular expression. (#8798)
'<' or '>' do not need to be escaped.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Andrew Choi <andrew.choi@uwaterloo.ca>, Jakob Homan
2020-09-02 17:30:00 +02:00
huxi 59206b895e
https://issues.apache.org/jira/browse/KAFKA-10456 (#9240)
Fix typo in description of ConsoleProducer.
2020-09-02 17:58:33 +08:00
David Arthur 241e1447fa
KAFKA-10444: Configure PR builds via Jenkinsfile (#9238) 2020-09-01 18:12:10 -04:00
Yuriy Badalyantc d0111d3bcd
KAFKA-10020: Create a new version of a scala Serdes without name clash (KIP-616) (#8955)
Wildcard import of the old org.apache.kafka.streams.scala.Serdes leads
to a name clash because some of implicits has the same names as types
from the scala's std lib. The new oak.streams.scala.serialization.Serdes is
the same as the old Serdes, but without name clashes.
The old one is marked as deprecated.

Also, add missing serdes for UUID, ByteBuffer and Short types in
the new Serdes.

Implements: KIP-616

Reviewers: John Roesler <vvcephei@apache.org>
2020-09-01 16:48:40 -05:00
leah 85b6545b81
KAFKA-5636: SlidingWindows (KIP-450) (#9039)
Add SlidingWindows API, implementation, and tests.
An edge case and an optimization are left to follow-on work.

Implements: KIP-450

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <mjsax@apache.org>, John Roesler <vvcephei@apache.org>
2020-08-31 17:22:00 -05:00
Bruno Cadonna 9da32b6bd0
KAFKA-9924: Add RocksDB metric num-entries-active-mem-table (#9177)
* Add the first RocksDB metric that exposes a RocksDB property: num-entries-active-mem-table.
* Add code StreamsMetricsImpl in support of exposing RocksDB properties
* unit tests and intergration tests

This commit only contains one metric to keep the PR at a reasonable size.
All other RocksDB metrics described in KIP-607 will be added in other PRs.

Implements: KIP-607
Reviewers: Guozhang Wang <guozhang@apache.org>, John Roesler <vvcephei@apache.org>
2020-08-27 18:04:28 -05:00
Colin Patrick McCabe b6ba67482f
KAFKA-10384: Separate converters from generated messages (#9194)
For the generated message code, put the JSON conversion functionality
in a separate JsonConverter class.

Make MessageDataGenerator simply another generator class, alongside the
new JsonConverterGenerator class.  Move some of the utility functions
from MessageDataGenerator into FieldSpec and other places, so that they
can be used by other generator classes.

Use argparse4j to support a better command-line for the generator.

Reviewers: David Arthur <mumrah@gmail.com>
2020-08-26 15:10:09 -07:00
Matthias J. Sax d2c978c98e
MINOR: fix JavaDoc (#9217)
Reviewer: John Roesler <john@confluent.io>
2020-08-26 10:31:16 -07:00
A. Sophie Blee-Goldman 22bcd9fac3
KAFKA-10054: KIP-613, add TRACE-level e2e latency metrics (#9094)
Adds avg, min, and max e2e latency metrics at the new TRACE level. Also adds the missing avg task-level metric at the INFO level.

I think where we left off with the KIP, the TRACE-level metrics were still defined to be "stateful-processor-level". I realized this doesn't really make sense and would be pretty much impossible to define given the DFS processing approach of Streams, and felt that store-level metrics made more sense to begin with. I haven't updated the KIP yet so I could get some initial feedback on this

Reviewers: Bruno Cadonna <bruno@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2020-08-24 17:37:49 -07:00
Raman Verma f19cd6ca48
KAFKA-10312; Fix error code returned in Metadata response when leader is not available (#9112)
MetadataCache#getPartitionMetadata returns an error when the topic's leader Id
is present at MetadataCache but listener endpoint is not present for this leader.
For older versions, LEADER_NOT_AVAILABLE is returned while LISTENER_NOT_FOUND is
returned for new metadata versions.

The problem is that getPartitionMetadata was looking up MetadataCache's host brokerId rather
than the topic's leader id while determining what error to return. This
could result in the call returning LISTENER_NOT_FOUND when it should
have returned LEADER_NOT_AVAILABLE. This commit corrects this behavior.

Unit tests were already present to test out the error codes returned
under different situations but they were giving out a false positive.
The test was using same broker id for both the MetadataCache's host as
well as for the topic's leader. Error manifests when the MetadataCache's
host id is changed. Improved the test.

This commit also consolidated couple of related tests to reduce code
duplication.

Reviewers: Jason Gustafson <jason@confluent.io>
2020-08-24 11:18:59 -07:00
Mickael Maison 8af7b96bfb
KAFKA-10367: Allow running the Streams demo app with a config file (#9131)
Update the 3 WordCount demos to accept a configuration file.

Reviewers: Matthias J. Sax <mjsax@apache.org>
2020-08-22 18:00:00 +02:00
Tom Bentley 8b94e62295
KAFKA-10211: Add DirectoryConfigProvider (#9136)
See KIP-632: https://cwiki.apache.org/confluence/display/KAFKA/KIP-632%3A+Add+DirectoryConfigProvider

Reviewers: Mickael Maison <mickael.maison@gmail.com>, David Jacot <david.jacot@gmail.com>
2020-08-22 17:10:48 +02:00
Jorge Esteban Quilcate Otoya 89d06780a0
KAFKA-9929: Support reverse iterator on KeyValueStore (#9137)
Add new methods to KeyValueStore interfaces to support reverse iteration.

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, John Roesler <vvcephei@apache.org>
2020-08-21 20:29:40 -05:00
John Thomas c8453e9a68
KAFKA-10316: Consider renaming getter method for Interactive Queries (#9146)
- updates docs for KIP-648

Reviewer: Matthias J. Sax <matthias@confluent.io>
2020-08-21 12:39:24 -07:00
serjchebotarev 567d76c7f8
KAFKA-10035: Safer conversion of consumer timeout parameters (#9028)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2020-08-21 12:35:34 -07:00
Justine Olshan a027b9a934
MINOR: Fix typo in ducker-ak test example
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-08-22 00:30:22 +05:30
David Arthur 1a9697430a
KAFKA-8806 Reduce calls to validateOffsetsIfNeeded (#7222)
Only check if positions need validation if there is new metadata. 

Also fix some inefficient java.util.stream code in the hot path of SubscriptionState.
2020-08-21 10:25:52 -04:00
Ron Dagostino a1db4a8010
KAFKA-10418: Improve kafka-topics help text for altering configs
Reviewers: Colin P. McCabe <cmccabe@apache.org>
2020-08-20 23:28:22 -07:00
John Roesler 88d4bc4641
KAFKA-10379: Implement the KIP-478 StreamBuilder#addGlobalStore() (#9148)
From KIP-478, implement the new StreamBuilder#addGlobalStore() overload
that takes a stateUpdateSupplier fully typed Processor<KIn, VIn, Void, Void>.

Where necessary, use the adapters to make the old APIs defer to the new ones,
as well as limiting the scope of this change set.

Reviewers: Boyang Chen <boyang@apache.org>
2020-08-20 14:06:16 -05:00
huxi 9cabc8c2b3
MINOR: Fix typo in LeaderEpochFileCacheTest (#9203)
Reviewers: David Jacot
2020-08-20 20:50:07 +05:30
huxi dc2b7d6f88
KAFKA-10407: Have KafkaLog4jAppender support `linger.ms` and `batch.size` (#9189)
* KAFKA-10407: Have KafkaLog4jAppender `batch.size` and `linger.ms`

https://issues.apache.org/jira/browse/KAFKA-10407

Currently, KafkaLog4jAppender does not support `batch.size` or `linger.ms` which would otherwise be beneficial in some situations.
2020-08-20 09:18:11 +08:00
Sanjana Kaundinya b7856df21b
MINOR: Include security configs for topic delete in system tests (#9142)
Reviewers: Ron Dagostino <rdagostino@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2020-08-19 13:37:27 +01:00
Boyang Chen 21dc5231ce
KAFKA-9705 part 1: add KIP-590 request header fields (#9144)
Reviewers: Colin P. McCabe <cmccabe@apache.org>, David Jacot <david.jacot@gmail.com>
2020-08-18 13:38:59 -07:00
A. Sophie Blee-Goldman 0779846901
KAFKA-10395: relax output topic check in TTD to work with dynamic routing (#9174)
Reviewers: Boyang Chen <boyang@apache.org>, Bruno Cadonna <bruno@confluent.io>, John Roesler <vvcephei@apache.org>
2020-08-18 09:39:40 -05:00
Andrew Egelhofer f6c26eaa04 MINOR: Use new version of ducktape
ducktape diff: https://github.com/confluentinc/ducktape/compare/v0.7.8...v0.7.9

- bcrypt (a dependency of ducktape) dropped Python2.7 support.
ducktape-0.7.9 now pins bcrypt to a Python2.7-supported version.

Author: Andrew Egelhofer <aegelhofer@confluent.io>

Reviewers: Dhruvil Shah <dhruvil@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>

Closes #9192 from andrewegel/trunk
2020-08-18 07:11:24 +05:30
Anna Povzner e8b2dcdee6
KAFKA-10023: Enforce broker-wide and per-listener connection creation… (#8768)
Implements the part of KIP-612 that adds broker configurations for broker-wide and per-listener connection creation rate limits and enforces these limits.

Reviewers: David Jacot <djacot@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2020-08-17 14:35:27 +01:00
Konstantine Karantasis e034fedbd3
KAFKA-10387: Fix inclusion of transformation configs when topic creation is enabled in Connect (#9172)
Addition of configs for custom topic creation with KIP-158 created a regression when transformation configs are also included in the configuration of a source connector. 

To experience the issue, just enabling topic creation at the worker is not sufficient. A user needs to supply a source connector configuration that contains both transformations and custom topic creation properties. 

The issue is that the enrichment of configs in `SourceConnectorConfig` happens on top of an `AbstractConfig` rather than a `ConnectorConfig`. Inheriting from the latter allows enrichment to be composable for both topic creation and transformations. 

Unit tests and integration tests are written to test these combinations. 

Reviewers: Randall Hauch <rhauch@gmail.com>
2020-08-16 21:12:50 -07:00
Rajini Sivaram d8d9d1a559
KAFKA-10404; Use higher poll timeout to avoid rebalance in testCoordinatorFailover (#9183)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-08-16 14:43:21 +01:00
Sanjana Kaundinya f7a4fe7c14
MINOR: fix the way total consumed is calculated for verifiable consumer (#9143)
Reviewers: Ron Dagostino <rdagostino@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2020-08-16 11:15:41 +01:00
Rajini Sivaram 70f10137f9
KAFKA-8033; Wait for NoOffsetForPartitionException in testFetchInvalidOffset (#9184)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-08-16 10:51:28 +01:00
Rajini Sivaram 3397cc9562
KAFKA-9516; Increase timeout in testNonBlockingProducer to make it more reliable (#9181)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-08-16 10:30:03 +01:00
albert02lowis 153db48866
KAFKA-9273: Extract testShouldAutoShutdownOnIncompleteMetadata from S… (#9108)
The main goal is to remove usage of embedded broker (EmbeddedKafkaCluster) in AbstractJoinIntegrationTest and its subclasses.
This is because the tests under this class are no longer using the embedded broker, except for two.
testShouldAutoShutdownOnIncompleteMetadata is one of such tests.
Furthermore, this test does not actually perfom stream-table join; it is testing an edge case of joining with a non-existent topic, so it should be in a separate test.

Testing strategy: run existing unit and integration test

Reviewers: Boyang Chen <boyang@confluent.io>, Bill Bejeck <bbejeck@apache.org>
2020-08-15 12:27:36 -04:00
Bruno Cadonna 5645d906fa
KAFKA-9924: Prepare RocksDB and metrics for RocksDB properties recording (#9098)
Refactor the RocksDB store and the metrics infrastructure in Streams
in preparation of the recordings of the RocksDB properties specified in KIP-607.

The refactoring includes:
* wrapper around BlockedBasedTableConfig to make the cache accessible to the
  RocksDB metrics recorder
* RocksDB metrics recorder now takes also the DB instance and the cache in addition
  to the statistics
* The value providers for the metrics are added to the RockDB metrics recorder also if
  the recording level is INFO.
* The creation of the RocksDB metrics recording trigger is moved to StreamsMetricsImpl

Reviewers: Guozhang Wang <wangguoz@gmail.com>, John Roesler <vvcephei@apache.org>
2020-08-13 14:40:40 -05:00
Jason Gustafson 3a189ad868
KAFKA-10386; Fix flexible version support for `records` type (#9163)
This patch fixes the generated serde logic for the 'records' type so that it uses the compact byte array representation consistently when flexible versions are enabled.

Reviewers: David Arthur <mumrah@gmail.com>
2020-08-13 09:52:23 -07:00
Guozhang Wang d0800b3f7c
KAFKA-10391: Overwrite checkpoint in task corruption to remove corrupted partitions (#9170)
In order to do this, I also removed the optimization such that once enforced checkpoint is set to true, we always checkpoint unless the state stores are not initialized at all (i.e. the snapshot is null).

Reviewers: Boyang Chen <boyang@confluent.io>, A. Sophie Blee-Goldman <ableegoldman@gmail.com>
2020-08-12 21:20:53 -07:00
Rajini Sivaram a15c1a9302
MINOR: Ensure same version of scala library is used for compile and at runtime (#9168)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-08-12 23:39:21 +01:00
A. Sophie Blee-Goldman 7fed816f03
MINOR: Add ableegoldman and cadonna to asf whitelist (#9171)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2020-08-12 10:32:03 -07:00
Boyang Chen b937ec7567
KAFKA-9911: Add new PRODUCER_FENCED error code (#8549)
Add a separate error code as PRODUCER_FENCED to differentiate INVALID_PRODUCER_EPOCH. On broker side, replace INVALID_PRODUCER_EPOCH with PRODUCER_FENCED when the request version is the latest, while still returning INVALID_PRODUCER_EPOCH to older clients. On client side, simply handling INVALID_PRODUCER_EPOCH the same as PRODUCER_FENCED if from txn coordinator APIs.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2020-08-12 08:54:01 -07:00
Jason Gustafson 89e12f3c6b
KAFKA-10388; Fix struct conversion logic for tagged structures (#9166)
The message generator was missing conversion logic for tagged structures. This led to casting errors when either `fromStruct` or `toStruct` were invoked. This patch also adds missing null checks in the serialization of tagged byte arrays, which was found from improved test coverage.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2020-08-12 08:29:59 -07:00