Commit Graph

450 Commits

Author SHA1 Message Date
Juan José Ramos 2092153d7f
KAFKA-14800: Bump snappy-java version to 1.1.9.1 (#13385)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
2023-03-24 16:27:06 +01:00
Mickael Maison ccfc389a63
KAFKA-14804: Update swagger plugin/dependencies to 2.2.8 (#13388)
Reviewers: David Arthur <mumrah@gmail.com>
2023-03-14 12:06:12 +01:00
Dejan Stojadinović e348da4095
MINOR: Update gradle to 8.0.2 and update several gradle plugins (#13339)
Also removed workaround from `build.gradle` that is no longer required after
the update to Gradle 8.0.2.

Related links:
 - zinc release notes:   https://github.com/sbt/zinc/releases/tag/v1.8.0
 - gradle release notes: https://github.com/gradle/gradle/releases/tag/v8.0.2
 - gradle diff:          https://github.com/gradle/gradle/compare/v8.0.1...v8.0.2

plugins version upgrade details:
 - 'com.github.ben-manes.versions'              0.44.0 -> 0.46.0
 - 'org.owasp.dependencycheck'                     8.0.2 -> 8.1.2
 - 'io.swagger.core.v3.swagger-gradle-plugin' 2.2.0 -> 2.2.8
 - 'org.gradle.test-retry'                                    1.5.1 -> 1.5.2
 - 'com.github.johnrengelman.shadow'           7.1.2 -> 8.1.0

Reviewers: Ismael Juma <ismael@juma.me.uk>
2023-03-04 22:25:00 -08:00
Dejan Stojadinović 72dd401e51
KAFKA-14680: Upgrade gradle version from 7.6 to 8.0.1 (#13205)
Details:
 * gradle upgrade: 7.6 -> 8.0.1
 * spotbugs plugin upgrade: 5.0.9 -> 5.0.13
 * tweaked the mechanics for `-release`/`-source`/`-target` to workaround idiosyncrasies in Gradle 8.0.1 and newer Scala 2.13 versions.
 * streams-scala `test` task no longer triggers the `spotless` task since a newer version is required for Gradle 8 support, but the newer version requires Java 11.
Note: relates to #5479

Gradle upgrade highlights:
* "Scala Incremental Compilation for Multi-Module projects broken in 7.x": https://github.com/gradle/gradle/issues/20101
* "Incremental compilation of java modules is broken with Gradle 7.6": https://github.com/gradle/gradle/issues/23067

Full release notes: https://docs.gradle.org/8.0/release-notes.html

Reviewers: Ismael Juma <ismael@juma.me.uk>
2023-02-23 19:13:43 -08:00
Ron Dagostino cbd46160e9
KAFKA-14731: Upgrade ZooKeeper to 3.6.4 (#13273)
Reviewers: Colin Patrick McCabe <cmccabe@apache.org>
2023-02-21 08:37:48 -05:00
Victoria Xia dcaf95a35f
KAFKA-14491: [8/N] Add serdes for ValueAndTimestamp with null value (#13249)
Introduces a new Serde, that serializes a value and timestamp as a single byte array, where the value may be null (in order to represent putting a tombstone with timestamp into the versioned store).

Part of KIP-889.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2023-02-15 18:07:47 -08:00
Ismael Juma 031d0ff1ba
MINOR: Update build and test dependencies for 3.5 (#13199)
The most recent version that didn't cause compiler or test errors was chosen.

Gradle plugin updates follow, they include minor fixes and support
for newer Java and Gradle versions:

- spotless: 6.10.0 -> 6.13.0
- versions: 0.42.0 -> 0.44.0
- dependencycheck: 7.1.1 -> 8.0.2
- rat: 0.7.1 -> 0.8.0
- spotbugs: 5.0.9 -> 5.0.13
- test-retry: 1.4.0 -> 1.5.1
- scoverage: 7.0.0 -> 7.0.1

Test/benchmark updates:

- jmh: 1.35 -> 1.36
GC profiler and perfasm improvements
https://mail.openjdk.org/pipermail/jmh-dev/2022-November/003553.html

- junit: 5.9.0 -> 5.9.2
Minor fixes
https://junit.org/junit5/docs/current/release-notes/index.html#release-notes-5.9.2

- jqwik: 1.6.5 -> 1.7.2
A number of usability improvements, bug fixes and minor breaking changes
https://jqwik.net/release-notes.html#172

- mockito: 4.6.1 -> 4.9.0
Usability improvements, perf fixes and bug fixes
https://github.com/mockito/mockito/releases/tag/v4.7.0
https://github.com/mockito/mockito/releases/tag/v4.8.0
https://github.com/mockito/mockito/releases/tag/v4.8.1
https://github.com/mockito/mockito/releases/tag/v4.9.0

Reviewers: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>, Luke Chen <showuon@gmail.com>
2023-02-09 15:16:39 +01:00
Satish Duggana 1d3fb76092
KAFKA-14688 Move package org.apache.kafka.server.log.internals to org.apache.kafka.storage.internals.log (#13213)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2023-02-08 09:22:42 +05:30
Ismael Juma 8ac644d2b1
KAFKA-14607: Move Scheduler/KafkaScheduler to server-common (#13092)
There were some concurrency inconsistencies in `KafkaScheduler` flagged by spotBugs
that had to be fixed, summary of changes below:
* Executor is `volatile`
* We always synchronize and check `isStarted` as the first thing within the critical
   section when a mutating operation is performed.
* We don't synchronize (but ensure the executor is not null in a safe way) in read-only
   operations that operate on the executor.

With regards to `MockScheduler/MockTask`:
* Set the type of `nextExecution` to `AtomicLong` and replaced inconsistent synchronization
* Extracted logic into `MockTask.rescheduleIfPeriodic`

Tweaked the `Scheduler` interface a bit:
* Removed `unit` parameter since we always used `ms` except one invocation
* Introduced a couple of `scheduleOnce` overloads to replace the usage of default
   arguments in Scala
* Pulled up `resizeThreadPool` to the interface and removed `isStarted` from the
  interface.

Other cleanups:
* Removed spotBugs exclusion affecting `kafka.log.LogConfig`, which no longer exists.

For broader context, see:
* KAFKA-14470: Move log layer to storage module

Reviewers: Jun Rao <junrao@gmail.com>
2023-01-10 23:51:58 -08:00
José Armando García Sancio 896573f9bc
KAFKA-14279: Add 3.3.x streams system tests (#13077)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2023-01-09 23:37:05 -08:00
Brendan Ribera b8ab09820c
KAFKA-14564: Upgrade netty to 4.1.86 to address CVE-2022-41881, CVE-2022-41915 (#13070)
For KAFKA-14564: upgrade to Netty 4.1.86

Fixes the following:

    CVE-2022-41881
    CVE-2022-41915

Reviewers: Luke Chen <showuon@gmail.com>
2023-01-04 16:55:05 +08:00
Ismael Juma e8232edd24
KAFKA-14477: Move LogValidator and related to storage module (#13012)
Also improved `LogValidatorTest` to cover a bug that was originally
only caught by `LogAppendTimeTest`.

For broader context on this change, please check:

* KAFKA-14470: Move log layer to storage module

Reviewers: Jun Rao <junrao@gmail.com>
2022-12-21 16:57:02 -08:00
Ismael Juma d521f8110e
KAFKA-14473: Move AbstractIndex to storage module (#13007)
For broader context on this change, please check:

* KAFKA-14470: Move log layer to storage module

Reviewers: Jun Rao <junrao@gmail.com>, Satish Duggana <satishd@apache.org>
2022-12-19 19:33:24 -08:00
Patrik Marton 1c10d107fe
KAFKA-14293: Basic Auth filter should set the SecurityContext after a successful login (#12846)
Reviewers: Greg Harris <greg.harris@aiven.io>, Chris Egerton <chrise@aiven.io>
2022-12-05 09:38:40 -05:00
Matthew de Detrich 6ae08c4ee8
KAFKA-14256: Upgrade from Scala 2.13.8 to 2.13.10 (#12675)
In addition to the version bump, we also had to:
* Update the zinc version
* Workaround compiler warnings via suppression (proper fix in a follow up)
* Adjust `testDeleteTopicDoesNotRetryThrottlingQuotaExceededException` to fix a test failure

Release notes:
* https://github.com/scala/scala/releases/tag/v2.13.9
* https://github.com/scala/scala/releases/tag/v2.13.10

Reviewers: Ismael Juma <ismael@juma.me.uk>
2022-12-04 21:02:43 -08:00
Ismael Juma 8d65271a0b
MINOR: Update Gradle to 7.6 (#12918)
The highlights are:
* Support for Java 19
* Support for incremental compilation following a compilation failure
* Flag for individual task rerun (eg "gradle test --rerun")
* Re-use Scala compiler between runs (will be enabled via #12280)

Release notes: https://docs.gradle.org/7.6/release-notes.html

Also adjusted the directory used by `retry_zinc` for the build output from
`build` to `logs` as `gradlew clean` was causing unintended deletion of
the file used by that tool to decide if a retry is required.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-11-30 05:25:56 -08:00
Pratim SC 795390a3c8
KAFKA-14320: Updated Jackson to version 2.13.4 for fixing CVE-2022-42004 (#12840)
* Updated Jackson to version 2.13.4 for fixing CVE-2022-42004, CVE-2020-36518
* Updated Jackson data bind to version 2.13.4.2 for fixing CVE-2022-42004

Co-authored-by: Pratim SC <pratim.sunilkumar.chaudhuri@mercer.com>

 Reviewers: Luke Chen <showuon@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
2022-11-18 23:28:49 +05:30
Christo Lolov 876c338a60
[KAFKA-14324] Upgrade RocksDB to 7.1.2 (#12809)
Reviewers: Bruno Cadonna <cadonna@confluent.io>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2022-11-11 17:48:38 -08:00
Manikumar Reddy 09b8d511f8
MINOR: Upgrade spotbugs dependency (#12768)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2022-10-24 23:11:31 +05:30
José Armando García Sancio 5c5dcb7a96
MINOR; Use 3.3.1 release for system test (#12714)
The following files are available in https://s3-us-west-2.amazonaws.com/kafka-packages/:

kafka-streams-3.3.1-test.jar
kafka_2.12-3.3.1.tgz
kafka_2.13-3.3.1.tgz

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2022-10-04 16:19:24 -07:00
Kirk True 8e43548175
KAFKA-13725: KIP-768 OAuth code mixes public and internal classes in same package (#12039)
* KAFKA-13725: KIP-768 OAuth code mixes public and internal classes in same package

Move classes into a sub-package of "internal" named "secured" that
matches the layout more closely of the "unsecured" package.

Replaces the concrete implementations in the former packages with
sub-classes of the new package layout and marks them as deprecated. If
anyone is already using the newer OAuth code, this should still work.

* Fix checkstyle and spotbugs violations

Co-authored-by: Kirk True <kirk@mustardgrain.com>

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-09-23 13:15:15 +05:30
Manikumar Reddy 3e8e082fab MINOR: Bump latest 2.8 version to 2.8.2 2022-09-19 17:18:47 +05:30
Tom Bentley 352c71ffb5
MINOR: Update release versions for upgrade tests with 3.0.2, 3.1.2, 3.2.3 release (#12661)
Updates release versions in files that are used for upgrade test with the 3.0.2, 3.1.2, 3.2.3 release version.
2022-09-19 17:13:40 +05:30
Matthew de Detrich e138772ba5
MINOR: Update Scalafmt to latest version (#12475)
Reviewers: Divij Vaidya <diviv@amazon.com>, Chris Egerton <fearthecellos@gmail.com>
2022-09-12 10:05:15 -04:00
Ismael Juma 3494d6eea3
MINOR: Upgrade gradle to 7.5.1 and bump other build/test dependencies (#12495)
Gradle 7.5.1:
* Important bug fixes including https://github.com/gradle/gradle/issues/21400
* Release notes: https://docs.gradle.org/7.5.1/release-notes.html

JUnit 5.9.0
* Support for open test reporting and configurable thread mode for @Timeout
* Release notes: https://junit.org/junit5/docs/current/release-notes/index.html#release-notes-5.9.0

test-retry-gradle-plugin 1.4.0
* Support for Gradle 7.6 and minor fixes
* Release notes:
  * https://github.com/gradle/test-retry-gradle-plugin/releases/tag/v1.3.2
  * https://github.com/gradle/test-retry-gradle-plugin/releases/tag/v1.4.0

spotbugs-gradle-plugin
* Minor fixes
* Release notes:
  * https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/5.0.7
  * https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/5.0.8
  * https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/5.0.9
 
dependency-check-gradle-plugin
* Minor improvements and false positive fixes
* Release notes:
  * https://github.com/jeremylong/DependencyCheck/releases/tag/v7.0.4
  * https://github.com/jeremylong/DependencyCheck/releases/tag/v7.1.0

rat-gradle-plugin
* Minor fixes
* Diff: https://github.com/eskatos/creadur-rat-gradle/compare/v0.7.0...v0.7.1

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-08-10 06:07:54 -07:00
Dalibor Plavcic eeee8e206b
MINOR: Upgrade mockito test dependencies (#12460)
## Changes
- **mockito: 4.4.0 -> 4.6.1** (https://github.com/mockito/mockito/releases)
Most important updates:
  - Fixes https://github.com/mockito/mockito/issues/2648 : Add support for customising strictness via @mock annotation and MockSettings https://github.com/mockito/mockito/pull/2650

## Why is this change needed?

According to the [Mockito documentation](https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#when(T)) :
> Although it is possible to verify a stubbed invocation, usually it's just redundant. Let's say you've stubbed foo.bar(). If your code cares what foo.bar() returns then something else breaks(often before even verify() gets executed). If your code doesn't care what get(0) returns then it should not be stubbed. 

While working on the [Replace EasyMock and PowerMock with Mockito for StreamsMetricsImplTest ](https://issues.apache.org/jira/browse/KAFKA-12947) I noticed that described behavior wasn't applied when you create a new `mock` like this.

```java
        final Metrics metrics = mock(Metrics.class);
        when(metrics.metric(metricName)).thenReturn(null);

        ... invoke SUT

        verify(metrics).metric(metricName); // this should be redundant (according to docs)

```

After further investigation I figured out that described behaviour wasn't implemented until`v4.6.1`.

With this change we are now able to mock objects like this:

```java
   Foo explicitStrictMock = mock(Foo.class, withSettings().strictness(Strictness.STRICT_STUBS));
```
- link to docs: [MockSettings.html#strictness](https://javadoc.io/static/org.mockito/mockito-core/4.6.1/org/mockito/quality/Strictness.html#STRICT_STUBS)

It looks like I can accomplish the same thing by using the `@RunWith(MockitoJUnitRunner.StrictStubs.class)
` instead of the `@RunWith(MockitoJUnitRunner.class)` so mockito dependency version update is not mandatory, but it would be nice to stay up-to-date and use the latest version (it's up to MR reviewer to decide if we are going to merge this now, or just close the MR and update mockito version later).

Reviewers: Ismael Juma <ismael@juma.me.uk>
2022-08-09 10:08:57 -07:00
Andrew Borley fdc19fbe21
KAFKA-14107: Upgrade Jetty version for CVE fixes (#12440)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Aaron Freeland <afreeland@gmail.com>
2022-08-05 23:29:04 +02:00
Ismael Juma 348474e2ae
MINOR: Upgrade to Gradle 7.5 (#12413)
Highlights:
* The default Scala Zinc version was updated from 1.3.5 to 1.6.1
* Multiple Checkstyle tasks may now run in parallel within a project
* Support for Java 18
* Much more responsive continuous builds on Windows and macOS
* Improved diagnostics for dependency resolution

Some of our tests require java.util and java.lang modules to be open,
so do it explicitly given the following Gradle bug fix:

> When running on Java 9+, Gradle no longer opens the java.base/java.util
> and java.base/java.lang JDK modules for all Test tasks. In some cases,
> this would cause code to pass during testing but fail at runtime.

Release notes: https://docs.gradle.org/7.5/release-notes.html

Reviewers:  Manikumar Reddy <manikumar.reddy@gmail.com>, Luke Chen <showuon@gmail.com>
2022-07-26 05:58:50 -07:00
Thomas Cooper aa735062eb
Upgrade Netty and Jackson versions for CVE fixes [KAFKA-14044] (#12376)
Reviewers: Luke Chen <showuon@gmail.com>
2022-07-05 14:16:18 +08:00
Bruno Cadonna 4d53dd9972
KAFKA-13930: Add 3.2.0 Streams upgrade system tests (#12209)
* KAFKA-13930: Add 3.2.0 Streams upgrade system tests

Apache Kafka 3.2.0 was recently released. Now we need
to test upgrades from 3.2 to trunk in our system tests.

Reviewer: Bill Bejeck <bbejeck@apache.org>
2022-06-21 16:33:40 +02:00
Chris Egerton 9e8ef8bb31
KAFKA-10000: Exactly-once source tasks (#11780)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Tom Bentley <tbentley@redhat.com>
2022-06-13 16:25:29 +02:00
Chris Egerton 6853d63e4d
KAFKA-10000: Zombie fencing logic (#11779)
Reviewers: Mickael Maison <mickael.maison@gmail.com>

, Tom Bentley <tbentley@redhat.com>
2022-06-10 14:35:35 +02:00
Mickael Maison 4a06458633
KAFKA-13780: Generate OpenAPI file for Connect REST API (#12067)
New gradle task `connect:runtime:genConnectOpenAPIDocs` that generates `connect_rest.yaml` under `docs/generated`.
This task is executed when `siteDocsTar` runs.
2022-06-10 11:35:22 +02:00
Tom Bentley 467bce04ae
MINOR: Update release versions for upgrade tests with 3.1.1 release (#12156)
Updates release versions in files that are used for upgrade test with the 3.1.1 release version.

Reviewers: Bruno Cadonna <bruno@confluent.io>
2022-05-13 09:32:41 +01:00
Bruno Cadonna 020ff2fe0e
MINOR: Update release versions for upgrade tests with 3.2.0 release (#12143)
Updates release versions in files that are used for upgrade test with the 3.2.0 release version.  

Reviewer: David Jacot <djacot@confluent.io>
2022-05-10 14:47:46 +02:00
Ismael Juma b964c07a68
MINOR: Upgrade build and test dependencies (#11984)
* gradle: 7.3.3 -> 7.4.2
  Configuration cache improvements and several other improvements.
  https://docs.gradle.org/7.4.2/release-notes.html
* dependencycheck gradle plugin: 6.5.3 -> 7.0.3
  Minor fixes.
* spotbugs gradle plugin: 5.0.5 -> 5.0.6
  Minor fixes.
  https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/5.0.6
* jmh: 1.34 -> 1.35
  Fixes and profiler improvements.
  https://mail.openjdk.java.net/pipermail/jmh-dev/2022-March/003422.html
* jqwik: 1.6.3 -> 1.6.5
  Various tweaks and some breaking changes that don't seem to affect us.
  https://github.com/jlink/jqwik/releases/tag/1.6.4
  https://github.com/jlink/jqwik/releases/tag/1.6.5
* mockito: 4.3.1 -> 4.4.0
  Add feature to verify static methods calls in order and minor fixes/improvements.
  https://github.com/mockito/mockito/releases/tag/v4.4.0

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-04-06 07:27:03 -07:00
Mike Lothian ecb0e8eece
KAFKA-13660: Switch log4j12 to reload4j (#11743)
This bumps the slf4j version to 1.7.36 and swaps out log4j 1.2.17 with
reload4j 1.2.19

Signed-off-by: Mike Lothian <mike@fireburn.co.uk>

Reviewers: Luke Chen <showuon@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Bruno Cadonna <cadonna@apache.org>
2022-03-30 20:54:01 +02:00
Edwin 76ca62a396
KAFKA-13775: CVE-2020-36518 - Upgrade jackson-databind to 2.12.6.1 (#11962)
CVE-2020-36518 vulnerability affects jackson-databind (see GHSA-57j2-w4cx-62h2).

Upgrading to jackson-databind version 2.12.6.1 addresses this CVE.

Reviewers: Luke Chen <showuon@gmail.com>, Bruno Cadonna <cadonna@apache.org>
2022-03-30 20:36:34 +02:00
Bruno Cadonna 3904652b3e
Upgrade RocksDB from 6.27.3 to 6.29.4.1 (#11967)
RocksDB 6.27.3 does not run on arm64 M1 Macs which would prevent people on this platform to run Kafka Streams. Thus, this PR upgrades RocksDB to 6.29.4.1 which contains the following fix to allow to run RocksDB on arm64 M1 Macs:

facebook/rocksdb#7720

The source compatibility report between 6.27.3 and 6.29.4.1 (attached to the ticket) reports a couple of incompatibilities. However, the incompatibilities do not seem to affect Kafka Streams' backwards compatibility.

    The changes to class RocksDB only apply when inheriting from RocksDB. RocksDB is not exposed to users in Streams.
    The changes to class WriteBatch and class WriteBatchInterface also only apply with inheritance. Both classes are not exposed to users in Streams.
    -The change to enum SanityLevel seem also not to apply to Streams since SanityLevel is only used in ConfigOptions which is only used to load options from files and properties objects. Loading options from files or properties is not exposed to users in Streams.

Reviewers: Bill Bejeck <bbejeck@apache.org>, Matthias J. Sax <mjsax@apache.org>, A. Sophie Blee-Goldman <ableegoldman@apache.org>
2022-03-30 14:04:47 +02:00
Mickael Maison 1783fb14df
MINOR: Bump latest 3.0 version to 3.0.1 (#11885)
Reviewers: Matthias J. Sax <mjsax@apache.org>
2022-03-16 11:43:37 +01:00
Mickael Maison 029a14b530
KAFKA-13510: Connect APIs to list all connector plugins and retrieve their configs (#11572)
Implements KIP-769: https://cwiki.apache.org/confluence/display/KAFKA/KIP-769%3A+Connect+APIs+to+list+all+connector+plugins+and+retrieve+their+configuration+definitions

Reviewers: Tom Bentley <tbentley@redhat.com>, Chris Egerton <fearthecellos@gmail.com>
2022-03-03 14:28:50 +01:00
Ismael Juma 7c2d672413
MINOR: Update library dependencies (Q1 2022) (#11306)
- scala 2.13: 2.13.6 -> 2.13.8
  * Support Java 18 and improve Android compatibility
  * https://www.scala-lang.org/news/2.13.7
  * https://www.scala-lang.org/news/2.13.8
- scala 2.12: 2.12.14 -> 2.12.15. 
  * The `-release` flag now works with Scala 2.12, backend parallelism
    can be enabled via `-Ybackend-parallelism N` and string interpolation
    is more efficient.
  * https://www.scala-lang.org/news/2.12.5
- gradle versions plugin: 0.38.0 -> 0.42.0
  * Minor fixes
  * https://github.com/ben-manes/gradle-versions-plugin/releases/tag/v0.40.0
  * https://github.com/ben-manes/gradle-versions-plugin/releases/tag/v0.41.0
  * https://github.com/ben-manes/gradle-versions-plugin/releases/tag/v0.42.0
- gradle dependency check plugin: 6.1.6 -> 6.5.3
  * Minor fixes
- gradle spotbugs plugin: 4.7.1 -> 5.0.5
  * Fixes and minor improvements
  * There were too many releases to include all the links, include the major version bump
  * https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/5.0.0
- gradle scoverage plugin: 5.0.0 -> 7.0.0
  * Support newer Gradle versions and other improvements
  * https://github.com/scoverage/gradle-scoverage/releases/tag/6.0.0
  * https://github.com/scoverage/gradle-scoverage/releases/tag/6.1.0
  * https://github.com/scoverage/gradle-scoverage/releases/tag/7.0.0
- gradle shadow plugin: 7.0.0 -> 7.1.2
  * Support gradle toolchains and security fixes
  * https://github.com/johnrengelman/shadow/releases/tag/7.1.0
  * https://github.com/johnrengelman/shadow/releases/tag/7.1.1
  * https://github.com/johnrengelman/shadow/releases/tag/7.1.2
- bcpkix: 1.66 -> 1.70
  * Several improvements and fixes
  * https://www.bouncycastle.org/releasenotes.html
- jline: 3.12.1 -> 3.21.0
  * Various fixes and improvements
- jmh: 1.32 -> 1.34
  * Compiler blackhole enabled by default when using Java 17 and improved
    gradle incremental compilation
  * https://mail.openjdk.java.net/pipermail/jmh-dev/2021-August/003355.html
  * https://mail.openjdk.java.net/pipermail/jmh-dev/2021-December/003406.html
- scalaLogging: 3.9.3 -> 3.9.4
  * Support for Scala 3.0
- jose4j: 0.7.8 -> 0.7.9
  * Minor fixes
- junit: 5.7.1 -> 5.8.2
  * Minor improvements and fixes
  * https://junit.org/junit5/docs/current/release-notes/index.html#release-notes-5.8.0
  * https://junit.org/junit5/docs/current/release-notes/index.html#release-notes-5.8.1
  * https://junit.org/junit5/docs/current/release-notes/index.html#release-notes-5.8.2
- jqwik: 1.5.0 -> 1.6.3
  * Numerous improvements
  * https://github.com/jlink/jqwik/releases/tag/1.6.0
- mavenArtifact: 3.8.1 -> 3.8.4
- mockito: 3.12.4 -> 4.3.1
  * Removed deprecated methods, `DoNotMock` annotation and
    minor fixes/improvements
  * https://github.com/mockito/mockito/releases/tag/v4.0.0
  * https://github.com/mockito/mockito/releases/tag/v4.1.0
  * https://github.com/mockito/mockito/releases/tag/v4.2.0
  * https://github.com/mockito/mockito/releases/tag/v4.3.0
- scalaCollectionCompat: 2.4.4 -> 2.6.0
  * Minor fixes
  * https://github.com/scala/scala-collection-compat/releases/tag/v2.5.0
  * https://github.com/scala/scala-collection-compat/releases/tag/v2.6.0
- scalaJava8Compat: 1.0.0 -> 1.0.2
  * Minor changes
- scoverage: 1.4.1 -> 1.4.11
  * Support for newer Scala versions
- slf4j: 1.7.30 -> 1.7.32
  * Minor fixes, 1.7.35 automatically uses reload4j and 1.7.33/1.7.34
    cause build failures, so we stick with 1.7.32 for now.
- zstd: 1.5.0-4 -> 1.5.2-1
  * zstd 1.5.2
  * Small refinements and performance improvements
  * https://github.com/facebook/zstd/releases/tag/v1.5.1
  * https://github.com/facebook/zstd/releases/tag/v1.5.2

Checkstyle, spotBugs and spotless will be upgraded separately as they
either require non trivial code changes or they have regressions
that affect us.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-02-07 15:24:50 -08:00
Luke Chen 0ab36e8b10
KAFKA-13579: Patch upgrade of netty/jetty/jackson (#11656)
Reviewers: Ismael Juma <ismael@juma.me.uk
2022-02-02 14:21:25 -08:00
Josep Prat cc3d22cc3b
MINOR: Upgrade to Gradle 7.3.3 (#11518)
Updates Gradle to its newer version 7.3.3. This version includes the
following relevant features:
- Support for Java 17
- Support for Scala 3

For a further description of the release notes see:
https://docs.gradle.org/7.3.3/release-notes.html

I did the update as per the description in Gradle's release notes:
```
./gradlew wrapper --gradle-version=7.3.3
```

This means `gradlew` script is updated to the newest version.

Verified that `gradlewAll jar` and `gradlew releaseTarGz` still succeed.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2022-02-02 05:47:05 -08:00
Jonathan Albrecht ec05f90a3d
KAFKA-13599: Upgrade RocksDB to 6.27.3 (#11690)
RocksDB v6.27.3 has been released and it is the first release to support s390x. RocksDB is currently the only dependency in gradle/dependencies.gradle without s390x support.

RocksDB v6.27.3 has added some new options that require an update to streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java but no other changes are needed to upgrade.

I have run the unit/integration tests locally on s390x and also the :streams tests on x86_64 and they pass.

Reviewers: Luke Chen <showuon@gmail.com>, Bruno Cadonna <cadonna@apache.org>
2022-02-02 10:56:14 +01:00
David Jacot 4ceb2191e1
MINOR: Upgrade netty to 4.1.73.Final (#11706)
Changelog: https://github.com/netty/netty/issues?q=is%3Aclosed+milestone%3A4.1.73.Final

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-01-24 17:08:03 +01:00
David Jacot 34208e8429
MINOR: Update files with 3.1.0 (#11698)
Reviewers: Bill Bejeck <bbejeck@apache.org>
2022-01-21 21:30:56 +01:00
David Jacot 3dd3f3ef03
MINOR: Upgrade jetty-server to 9.4.44.v20210927 (#11692)
Release notes: https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.44.v20210927

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
2022-01-20 14:14:44 +01:00
Bruno Cadonna 9e579587ac
MINOR: Bump version of grgit to 4.1.1 (#11561)
grgit 4.1.0 caused unsupported version error during gradle builds.
The reason was that grgit 4.1.0 uses always the latest JGit version
internally. Unfortunately, the latest JGit version was compiled with
a Java version later than Java 8 which caused the unsupported version
error during gradle builds for Java 8.

grgit 4.1.1 fixed this issue by upper bounding the version of JGrit
to a version that is still compiled with Java 8. Consequently, we can
remove the hotfix we merged in commit d1e0d2b474
and instead bump the grgit version from 4.1.0 to 4.1.1.

Reviewer: John Roesler <vvcephei@apache.org>
2021-12-07 18:24:43 +01:00
John Roesler 14c2449050
KAFKA-13491: IQv2 framework (#11557)
Implements the major part of the IQv2 framework as proposed in KIP-796.

Reviewers: Patrick Stuedi <pstuedi@apache.org>, Vicky Papavasileiou <vpapavasileiou@confluent.io>, Bruno Cadonnna <cadonna@apache.org>
2021-12-03 12:53:31 -06:00
Bruno Cadonna d1e0d2b474
HOTFIX: Set version of jgit to avoid unsupported version error (#11554)
A new version of JGit that is used by grgit that is used by gradle
causes the following error:

org/eclipse/jgit/storage/file/FileRepositoryBuilder has been compiled
by a more recent version of the Java Runtime (class file version 55.0),
this version of the Java Runtime only recognizes class file versions
up to 52.0

The reason is that version 6.0.0.202111291000-r of JGrit was compiled
with a newer Java version than Java 8, probably Java 11.

Explicitly setting the version of JGrit in gradle to 5.12.0.202106070339-r fixes
the issue.

Reviewers: David Jacot <djacot@confluent.io>, Ismael Juma <ismael@juma.me.uk>, Alexander Stohr, David Arthur <mumrah@gmail.com>
2021-11-30 18:42:41 +01:00
Kirk True 7b379539a5
KAFKA-13202: KIP-768: Extend SASL/OAUTHBEARER with Support for OIDC (#11284)
This task is to provide a concrete implementation of the interfaces defined in KIP-255 to allow Kafka to connect to an OAuth/OIDC identity provider for authentication and token retrieval. While KIP-255 provides an unsecured JWT example for development, this will fill in the gap and provide a production-grade implementation.

The OAuth/OIDC work will allow out-of-the-box configuration by any Apache Kafka users to connect to an external identity provider service (e.g. Okta, Auth0, Azure, etc.). The code will implement the standard OAuth client credentials grant type.

The proposed change is largely composed of a pair of AuthenticateCallbackHandler implementations: one to login on the client and one to validate on the broker.

See the following for more detail:

KIP-768
KAFKA-13202

Reviewers: Yi Ding <dingyi.zj@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Jun Rao <junrao@gmail.com>
2021-10-28 11:36:53 -07:00
David Jacot 493280735b
MINOR: Bump latest 2.8 version to 2.8.1 (#11341)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2021-09-20 09:23:15 +02:00
Lee Dongjin c558d94c43
KAFKA-13294: Upgrade Netty to 4.1.68 (#11324)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-09-17 05:34:37 -07:00
Bruno Cadonna 08d5840fba
KAFKA-13287: Upgrade RocksDB to 6.22.1.1 (#11317)
This commit upgrades RocksDB from 6.19.3 to 6.22.1.1

Reviewer: Anna Sophie Blee-Goldman <ableegoldman@apache.org>
2021-09-13 09:30:47 +02:00
Ismael Juma 49f7c824fa
MINOR: Upgrade compression libraries (#11303)
lz4-java: 1.7.1 -> 1.8.0

The most noteworthy change is the upgrade of the
underlying C library to 1.9.3. Details:

* https://github.com/lz4/lz4-java/releases/tag/1.8.0
* https://github.com/lz4/lz4/releases/tag/v1.9.3

snappy-java: 1.1.8.1 -> 1.1.8.4

The most noteworthy change is support for Apple M1.
Details:

* https://github.com/xerial/snappy-java/releases/tag/1.1.8.2 
* https://github.com/xerial/snappy-java/releases/tag/1.1.8.3
* https://github.com/xerial/snappy-java/releases/tag/1.1.8.4

zstd-jni: 1.5.0-2 -> 1.5.0-4

Minor fixes, details:

* https://github.com/luben/zstd-jni/releases/tag/v1.5.0-3
* https://github.com/luben/zstd-jni/releases/tag/v1.5.0-4

Reviewers: David Jacot <djacot@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Luke Chen <showuon@gmail.com>, Josep Prat <josep.prat@aiven.io>
2021-09-07 08:46:21 -07:00
Ismael Juma 0118330103
KAFKA-13273: Add support for Java 17 (#11296)
Java 17 is at release candidate stage and it will be a LTS release once
it's out (previous LTS release was Java 11).

Details:
* Replace Java 16 with Java 17 in Jenkins and Readme.
* Replace `--illegal-access=permit` (which was removed from Java 17)
   with  `--add-opens` for the packages we require internal access to.
   Filed KAFKA-13275 for updating the tests not to require `--add-opens`
   (where possible).
* Update `release.py` to use JDK8. and JDK 17 (instead of JDK 8 and JDK 15).
* Removed all but one Streams test from `testsToExclude`. The
   Connect test exclusion list remains the same.
* Add notable change to upgrade.html
* Upgrade to Gradle 7.2 as it's required for proper Java 17 support.
* Upgrade mockito to 3.12.4 for better Java 17 support.
* Adjusted `KafkaRaftClientTest` and `QuorumStateTest` not to require
   private access to `jdk.internal.util.random`.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2021-09-06 08:55:52 -07:00
Justine Olshan b923ec236e
KAFKA-13209: Upgrade jetty-server to fix CVE-2021-34429
Upgrading to 9.4.43.v20210629
Release notes: https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.43.v20210629

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2021-08-17 23:56:17 +05:30
Josep Prat 83f0ae3821
KAFKA-12862: Update Scala fmt library and apply fixes (#10784)
Updates the scala fmt to the latest stable version.
Applies all the style fixes (all source code changes are done by scala 
fmt).
Removes setting about dangling parentheses as `true` is already the
default.

Reviewer: John Roesler <john@confluent.io>
2021-08-09 12:05:31 +02:00
Kamal Chandraprakash a103c95a31
KAFKA-12724: Add 2.8.0 to system tests and streams upgrade tests. (#10602)
Also adjusted the acceptable recovery lag to stabilize Streams tests.

Reviewers: Justine Olshan <jolshan@confluent.io>, Matthias J. Sax <mjsax@apache.org>, John Roesler <vvcephei@apache.org>
2021-08-04 17:31:10 -05:00
Ron Dagostino cd24e1233e
MINOR: Update dropwizard library to 4.1.12.1 (#10982)
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Luke Chen <showuon@gmail.com>
2021-07-08 11:00:46 -07:00
Tom Bentley 19e8fd513a
KAFKA-9687: KIP-707: Add KafkaFuture.toCompletionStage() (#9878)
* Improve the test prior to reimplementing KafkaFutureImpl using CompletableFuture.
* KAFKA-9687: Reimplement KafkaFutureImpl using a CompleteableFuture
* KIP-707: Add KafkaFuture.toCompletionStage

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>, Konstantine Karantasis <k.karantasis@gmail.com>
2021-07-05 17:33:33 +01:00
Ismael Juma 855011f92a
MINOR: Upgrade Gradle to 7.1.1 and remove JDK 15 build (#10968)
Gradle 7.1 improves Java incremental compilation:
https://docs.gradle.org/7.1.1/release-notes.html

We previously kept the JDK 15 build because some
tests didn't work with JDK 16. Since then, a number
of PRs were submitted to fix this so it's best
to remove the JDK 15 build before we create the
3.0 release branch.

Finally bump `test-retry` gradle plugin version too.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Luke Chen <showuon@gmail.com>
2021-07-04 10:55:16 -07:00
Lee Dongjin fa685fa152
KAFKA-12985: Upgrade jetty to 9.4.42 (#10919)
* 9.4.41 announcement: https://www.eclipse.org/lists/jetty-announce/msg00156.html
* 9.4.42 announcement: https://www.eclipse.org/lists/jetty-announce/msg00158.html

Reviewers: Luke Chen <showuon@gmail.com>, Ismael Juma <ismael@juma.me.uk>
2021-07-04 07:48:25 -07:00
Ron Dagostino 4f5b4c868e
KAFKA-12756: Update ZooKeeper to v3.6.3 (#10918)
Update the ZooKeeper version to v3.6.3. This requires adding dropwizard
as a new dependency.

Also, add Kafka v2.8.0 to the ducktape system test image.

Reviewers: Luke Chen <showuon@gmail.com>, Colin P. McCabe <cmccabe@apache.org>, Ismael Juma <ismael@juma.me.uk>
2021-06-30 11:21:33 -07:00
CHUN-HAO TANG 580c111258
KAFKA-12662: add unit test for ProducerPerformance (#10588)
Reviewers: Luke Chen <showuon@gmail.com>, wenbingshen <oliver.shen999@gmail.com>, dengziming <dengziming1993@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2021-06-17 20:07:12 +08:00
David Christle 39b9df5090
KAFKA-12921: Upgrade zstd-jni to 1.5.0-2 (#10847)
This PR aims to upgrade `zstd-jni` from `1.4.9-1` to `1.5.0-2`.

This change will incorporate a number of bug fixes and performance improvements made in `1.5.0` of `zstd`:
- https://github.com/facebook/zstd/releases/tag/v1.5.0
- https://github.com/luben/zstd-jni/releases/tag/v1.5.0-1
- https://github.com/luben/zstd-jni/releases/tag/v1.5.0-2

The most recent `1.5.0` release offers +25%-140% (compression) and +15% (decompression) performance
improvements under certain conditions. Those conditions are unlikely to apply to Kafka with the default
configuration, however.

Since this is a dependency change, this should pass all the existing CIs.

Reviewers: Lee Dongjin <dongjin@apache.org>, Ismael Juma <ismael@juma.me.uk>
2021-06-13 09:14:24 -07:00
Ismael Juma 1dadb6db0c
MINOR: Only log overridden topic configs during topic creation (#10828)
It's quite verbose to include all configs for every partition loaded/created.
Also make sure to redact sensitive and unknown config values.

Unit test included.

Reviewers: David Jacot <djacot@confluent.io>, Kowshik Prakasam <kprakasam@confluent.io>, Luke Chen <showuon@gmail.com>
2021-06-08 06:39:31 -07:00
Ismael Juma 8b71604c5d
MINOR: Update jmh for async profiler 2.0 support (#10800)
Async profiler 2.0 outputs html5 flame graph files
and supports simultaneous collection of cpu,
allocation and lock profiles in jfr format.

Updated the readme to include an example of the
latter and verified that the Readme commands
work with async profiler 2.0.

Release notes:
* 1.28: https://mail.openjdk.java.net/pipermail/jmh-dev/2021-March/003171.html
* 1.29: https://mail.openjdk.java.net/pipermail/jmh-dev/2021-March/003218.html
* 1.30: https://mail.openjdk.java.net/pipermail/jmh-dev/2021-May/003237.html
* 1.31: https://mail.openjdk.java.net/pipermail/jmh-dev/2021-May/003286.html
* 1.32: https://mail.openjdk.java.net/pipermail/jmh-dev/2021-May/003307.html

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Jacot <djacot@confluent.io>, Luke Chen <showuon@gmail.com>
2021-06-02 05:55:01 -07:00
Josep Prat 274eccf922
MINOR: Dependency updates for Scala libraries for improved Scala 3.0 support (#10783)
Release notes:
* Scala 2.12.14: https://github.com/scala/scala/releases/tag/v2.12.14
* Scala Logging: https://github.com/lightbend/scala-logging/releases/tag/v3.9.3
* Scala Collection Compat:
  *  https://github.com/scala/scala-collection-compat/releases/tag/v2.3.1
  * https://github.com/scala/scala-collection-compat/releases/tag/v2.3.2
  * https://github.com/scala/scala-collection-compat/releases/tag/v2.4.0
  * https://github.com/scala/scala-collection-compat/releases/tag/v2.4.1
  * https://github.com/scala/scala-collection-compat/releases/tag/v2.4.2
  * https://github.com/scala/scala-collection-compat/releases/tag/v2.4.3
  * https://github.com/scala/scala-collection-compat/releases/tag/v2.4.4
* Scala Java8 Compat:
  * https://github.com/scala/scala-java8-compat/releases/tag/v1.0.0-RC1
  * https://github.com/scala/scala-java8-compat/releases/tag/v1.0.0

Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-05-31 12:06:37 -07:00
Ismael Juma 23130262ca
KAFKA-12856: Upgrade Jackson to 2.12.3 (#10778)
2.10.x is no longer supported, so we should move to 2.12 for the 3.0
release.

ScalaObjectMapper has been deprecated and it looks like we don't
actually need it, so remove its usage.

Reviewers: David Jacot <djacot@confluent.io>
2021-05-27 09:56:33 -07:00
Josep Prat a02b19cb77
KAFKA-12796: Removal of deprecated classes under streams-scala (#10710)
Removes previously deprecated methods in older KIPs

Reviewers: Bruno Cadonna <cadonna@apache.org>
2021-05-27 11:30:15 +02:00
Lee Dongjin 57c1422468
KAFKA-12820: Upgrade maven-artifact dependency to resolve CVE-2021-26291
CVE-2021-26291, which makes Man-In-The-Middle-Attack possible, was fixed in maven 3.8.1.

Reviewers: Luke Chen <showuon@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
2021-05-21 12:37:07 +05:30
Mickael Maison 7f91d2935f
MINOR: Updating files with release 2.7.1 (#10660)
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>,  Matthias J. Sax <mjsax@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
2021-05-20 10:43:15 +01:00
Josep Prat a8bd649dbf
MINOR: Update Scala to 2.13.6 (#10711)
This includes TASTy Reader support for Scala 3.0.0. This makes it easier
for Kafka libraries to be used in Scala 3.0 projects

Release notes: https://github.com/scala/scala/releases/tag/v2.13.6

Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-05-19 05:26:08 -07:00
Dejan Stojadinović ad91c5edf0
KAFKA-12728: Upgrade gradle to 7.0.2 and shadow to 7.0.0 (#10606)
Details:
* gradle upgrade: 6.8.3 -> 7.0.2
  https://github.com/gradle/gradle/releases/tag/v7.0.0
  https://github.com/gradle/gradle/releases/tag/v7.0.1
  https://github.com/gradle/gradle/releases/tag/v7.0.2
* 'distributionSha256Sum' gradle property is included into 'gradle-wrapper.properties' file
* gradle shadow plugin upgrade: 6.1.0 -> 7.0.0
  https://github.com/johnrengelman/shadow/releases/tag/7.0.0
* Remaining configurations obsoleted in Gradle 6 (and removed in Gradle 7) are replaced:
  `compile` -> `implementation`
  `testCompile` -> `testImplementation`

Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-05-15 06:10:04 -07:00
Ismael Juma 13ffebe2f1
MINOR: Update jacoco to 0.8.7 for JDK 16 support (#10654)
Details:
* https://github.com/jacoco/jacoco/releases/tag/v0.8.6
* https://github.com/jacoco/jacoco/releases/tag/v0.8.7

Ran `./gradlew clients:reportCoverage -PenableTestCoverage=true -Dorg.gradle.parallel=false`
successfully with Java 15 (see https://github.com/gradle/gradle/issues/15730 and
https://github.com/scoverage/gradle-scoverage/issues/150 for the reason why 
`-Dorg.gradle.parallel=false` is required).

Also updated `README.md` to include `-Dorg.gradle.parallel=false` alongside `reportCoverage`.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-05-12 08:13:03 -07:00
Dejan Stojadinović 9bec36256e
MINOR: Remove unused `scalatest` definition from `dependencies.gradle` (#10655)
Related PR where the `scalatest` usage was removed: #9858

Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-05-09 19:22:29 -07:00
Dejan Stojadinović d934647484
MINOR: checkstyle version upgrade: 8.20 -> 8.36.2 (#10656)
Details:
* Release notes: https://checkstyle.org/releasenotes.html#Release_8.36.2
* Checkstyle version 8.42 should be skipped (lots of false positives, see here: https://github.com/checkstyle/checkstyle/issues/9957)
* More recent Checkstyle versions (i.e. 8.37 and above) are imposing more strict indentation
rules.
2021-05-09 19:03:14 -07:00
Bruno Cadonna 90fc875e24
KAFKA-8897: Upgrade RocksDB to 6.19.3 (#10568)
This PR upgrades RocksDB to 6.19.3. After the upgrade the Gradle build exited with code 134 due to SIGABRT signals ("Pure virtual function called!") coming from the C++ part of RocksDB. This error was caused by RocksDB state stores not properly closed in Streams' code. This PR adds the missing closings and updates the RocksDB option adapter.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Guozhang Wang <wangguoz@gmail.com>
2021-05-06 15:29:26 -07:00
Shay Elkin b73d639adc
KAFKA-12752: Bump Jersey deps to 2.34 due to CVE-2021-28168 (#10636)
The version of the Eclipse Jersey library brought as dependences,
2.31, has a known vulnerability, CVE-2021-28168 (https://github.com/advisories/GHSA-c43q-5hpj-4crv).

This replaces it with 2.34, which is fully compatible with
2.31, except for bugs and vulnerabilities.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2021-05-06 20:14:03 +05:30
Ismael Juma 711608b3b1
MINOR: Update test libraries and gradle plugins for better JDK 16/17 support (#10619)
Details:
* spotbugs gradle plugin from 4.6.0 to 4.7.1:
  https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.6.1
  https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.6.2
  https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.7.0
  https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.7.1
* spotless gradle plugin from 5.10.2 to 5.12.4:
  https://github.com/diffplug/spotless/blob/gradle/5.12.4/CHANGES.md
* test-retry gradle plugin from 1.2.0 to 1.2.1:
  https://github.com/gradle/test-retry-gradle-plugin/releases/tag/v1.2.1
* dependency check gradle plugin from 6.1.1 to 6.1.6:
  https://github.com/jeremylong/DependencyCheck/releases/tag/v6.1.2
  https://github.com/jeremylong/DependencyCheck/releases/tag/v6.1.3
  https://github.com/jeremylong/DependencyCheck/releases/tag/v6.1.4
  https://github.com/jeremylong/DependencyCheck/releases/tag/v6.1.5
  https://github.com/jeremylong/DependencyCheck/releases/tag/v6.1.6
* versions gradle plugin from 0.36.0 to 0.38.0:
https://github.com/ben-manes/gradle-versions-plugin/releases/tag/v0.37.0
https://github.com/ben-manes/gradle-versions-plugin/releases/tag/v0.38.0
* easymock from 4.2 to 4.3:
  https://github.com/easymock/easymock/releases/tag/easymock-4.3
* mockito from 3.6.0 to 3.9.0:
https://github.com/mockito/mockito/releases (too many releases to list
  them all individually)
* spotbugs from 4.1.4 to 4.2.2:
  https://github.com/spotbugs/spotbugs/blob/4.2.2/CHANGELOG.md
  4.2.3 has a regression that causes spurious errors related to `Random`
  usage.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-05-02 12:15:54 -07:00
A. Sophie Blee-Goldman 3bfc9fe486
MINOR: Bump latest 2.6 version to 2.6.2 (#10582)
Bump the version for system tests to 2.6.2
2021-04-21 12:50:30 -07:00
Lee Dongjin 235d13ff2a
KAFKA-12655 Update Jetty: 9.4.38.v20210224 → 9.4.39.v20210325 (#10526)
Reviewers: Edwin <edwinhobor@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Luke Chen, xjin-Confluent, Chia-Ping Tsai <chia7712@gmail.com>
2021-04-13 14:40:55 +08:00
Jim Hurne 1e8a7c45ef
MINOR: Switch to using the Gradle RAT plugin (#10491)
The Gradle RAT plugin properly declares inputs and outputs and is also
cachable. This also relieves the Kafka developers from maintaining the build
integration with RAT.

The generated RAT report is identical to the one generated previously. The only
difference is the RAT report name: the RAT plugin sets the HTML report name to
`index.html` (still under `build/rat`).

Verified that the rat task fails if unlicensed files are present (and not excluded). Also
`./gradlew rat` succeeds when there is no .git folder.
2021-04-12 21:05:49 -07:00
Lee Dongjin b6a787a072
KAFKA-12583: Upgrade netty to 4.1.62.Final
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-03-31 08:45:30 -07:00
Chia-Ping Tsai 9af81955c4
KAFKA-12173 Migrate streams:streams-scala module to JUnit 5 (#9858)
1. replace org.junit.Assert by org.junit.jupiter.api.Assertions
2. replace org.junit by org.junit.jupiter.api
3. replace Before by BeforeEach
4. replace After by AfterEach
5. remove ExternalResource from all scala modules
6. add explicit AfterClass/BeforeClass to stop/start EmbeddedKafkaCluster

Noted that this PR does not migrate stream module to junit 5 so it does not introduce callback of junit 5 to deal with beforeAll/afterAll. The next PR of migrating stream module can replace explicit beforeAll/afterAll by junit 5 extension. Or we can keep the beforeAll/afterAll if it make code more readable.

Reviewers: John Roesler <vvcephei@apache.org>
2021-03-25 01:04:39 +08:00
Dejan Stojadinović 9ffa6d6d74
KAFKA-12293: Remove JCenter from buildscript and delete buildscript.gradle
They're no longer used and JFrog is sunsetting JCenter.

https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter

Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-03-18 07:27:14 -07:00
Jason Gustafson 8ef1619f3e
KAFKA-12459; Use property testing library for raft event simulation tests (#10323)
This patch changes the raft simulation tests to use jqwik, which is a property testing library. This provides two main benefits:

- It simplifies the randomization of test parameters. Currently the tests use a fixed set of `Random` seeds, which means that most builds are doing redundant work. We get a bigger benefit from allowing each build to test different parameterizations.
- It makes it easier to reproduce failures. Whenever a test fails, jqwik will report the random seed that failed. A developer can then modify the `@Property` annotation to use that specific seed in order to reproduce the failure.

This patch also includes an optimization for `MockLog.earliestSnapshotId` which reduces the time to run the simulation tests dramatically.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>, José Armando García Sancio <jsancio@gmail.com>, David Jacot <djacot@confluent.io>
2021-03-17 19:20:07 -07:00
Dongjoon Hyun 1f9c9f8bb5
KAFKA-12442: Upgrade ZSTD JNI from 1.4.8-4 to 1.4.9-1 (#10285)
Since the new features are not used, you may right. However, I believe the benefits are three-fold.
- There exists ZSTD side bug-fixes at ZSTD 1.4.9.
- There exists ZSTD JNI side memory optimization improvements at ZSTD JNI 1.4.8-5 ~ 1.4.8-7. (This includes some incompatible changes and recovery. So, 1.4.9 is more human-readable stable version number.).
- I hope this will reduce the chance of future potential version conflict issues across Apache projects. It's important when some downstream project starts to use new feature.
   - Apache Spark 3.2.0 will use ZSTD 1.4.9. (ba7e525a11)
   - Apache Parquet 1.12.0 will use ZSTD 1.4.9 (66ac28ce23)
   - Apache Avro 1.10.3 will use ZSTD 1.4.9 (806667cb2b)

Reviewers: Lee Dongjin <dongjin@apache.org>, Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2021-03-12 13:37:33 +08:00
Ismael Juma 7a3ebbebbc
KAFKA-12415 Prepare for Gradle 7.0 and restrict transitive scope for non api dependencies (#10203)
Gradle 7.0 is required for Java 16 compatibility and it removes a number of
deprecated APIs. Fix most issues preventing the upgrade to Gradle 7.0.
The remaining ones are more complicated and should be handled
in a separate PR. Details of the changes:

* Release tarball no longer includes includes test, sources, javadoc and test sources jars (these
are still published to the Maven Central repository).
* Replace `compile` with `api` or `implementation` - note that `implementation`
dependencies appear with `runtime` scope in the pom file so this is a (positive)
change in behavior
* Add missing dependencies that were uncovered by the usage of `implementation`
* Replace `testCompile` with `testImplementation`
* Replace `runtime` with `runtimeOnly` and `testRuntime` with `testRuntimeOnly`
* Replace `configurations.runtime` with `configurations.runtimeClasspath`
* Replace `configurations.testRuntime` with `configurations.testRuntimeClasspath` (except for
the usage in the `streams` project as that causes a cyclic dependency error)
* Use `java-library` plugin instead of `java`
* Use `maven-publish` plugin instead of deprecated `maven` plugin - this changes the
commands used to publish and to install locally, but task aliases for `install` and
`uploadArchives` were added for backwards compatibility
* Removed `-x signArchives` line from the readme since it was wrong (it was a
no-op before and it fails now, however)
* Replaces `artifacts` block with an approach that works with the `maven-publish` plugin
* Don't publish `jmh-benchmark` module - the shadow jar is pretty large and not
particularly useful (before this PR, we would publish the non shadow jars)
* Replace `version` with `archiveVersion`, `baseName` with `archiveBaseName` and
`classifier` with `archiveClassifier`
* Update Gradle and plugins to the latest stable version (7.0 is not stable yet)
* Use `plugin` DSL to configure plugins
* Updated notable changes for 3.0

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Randall Hauch <rhauch@gmail.com>
2021-03-04 11:22:22 -08:00
Lee Dongjin b77deece1d KAFKA-12400: Upgrade jetty to fix CVE-2020-27223
Here is the fix. The reason of [CVE-2020-27223](https://nvd.nist.gov/vuln/detail/CVE-2020-27223) was DOS vulnerability for Quoted Quality CSV headers and [patched in 9.4.37.v20210219](https://github.com/eclipse/jetty.project/security/advisories/GHSA-m394-8rww-3jr7).

This PR updates Jetty dependency into the following version, 9.4.38.v20210224.

Author: Lee Dongjin <dongjin@apache.org>

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>

Closes #10245 from dongjinleekr/feature/KAFKA-12400
2021-03-03 10:13:40 +05:30
Lee Dongjin 4b3e3a9e86 y
This security vulnerability was found in netty-codec-http, but [caused by netty itself](c735357bf2) and [fixed in 4.1.59.Final](https://github.com/netty/netty/security/advisories/GHSA-5mcr-gq6c-3hq2). So, upgrade the netty version from 4.1.51.Final to 4.1.59.Final.

Author: Lee Dongjin <dongjin@apache.org>

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>

Closes #10235 from dongjinleekr/feature/KAFKA-12389
2021-03-03 09:45:24 +05:30
Ismael Juma 6f2cb60ef6
KAFKA-12341: Ensure consistent versions for javassist (#10191)
And update to 3.27.0-GA.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-02-23 10:47:53 -08:00
Manikumar Reddy a74b5eb0df MINOR: Update HttpClient to "4.5.13"
Update HttpClient to recent bug fix version 4.5.13.

Author: Manikumar Reddy <manikumar.reddy@gmail.com>

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

Closes #10188 from omkreddy/http-client
2021-02-23 15:10:24 +05:30
Ismael Juma dd34e40f3e
MINOR: Update Scala to 2.13.5 (#10169)
This includes a fix from Chia-Ping that removes tuple
allocations when `Map.forKeyValue` is used
(https://github.com/scala/scala/pull/9425) and support
for JDK 16.

Release notes:
https://github.com/scala/scala/releases/tag/v2.13.5

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-02-22 22:02:38 -08:00
Lee Dongjin c71ec552d1 KAFKA-12324: Upgrade jetty to fix CVE-2020-27218
Here is the fix. The reason of [CVE-2020-27218](https://nvd.nist.gov/vuln/detail/CVE-2020-27218) was [Incorrect recycling of `HttpInput`](https://bugs.eclipse.org/bugs/show_bug.cgi?id=568892) and [patched in 9.4.35.v20201120](https://github.com/eclipse/jetty.project/security/advisories/GHSA-86wm-rrjm-8wh8).

This PR updates Jetty dependency into the following version, 9.4.36.v20210114.

Author: Lee Dongjin <dongjin@apache.org>

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>

Closes #10177 from dongjinleekr/feature/KAFKA-12324
2021-02-22 23:19:06 +05:30
Chia-Ping Tsai 6bab96da04
KAFKA-12335 Upgrade junit from 5.7.0 to 5.7.1 (#10145)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-02-20 11:27:46 +08:00
Colin P. Mccabe 690f72dd69 KAFKA-12334: Add the KIP-500 metadata shell
The Kafka Metadata shell is a new command which allows users to
interactively examine the metadata stored in a KIP-500 cluster.
It can examine snapshot files that are specified via --snapshot.

The metadata tool works by replaying the log and storing the state into
in-memory nodes.  These nodes are presented in a fashion similar to
filesystem directories.

Reviewers: Jason Gustafson <jason@confluent.io>, David Arthur <mumrah@gmail.com>, Igor Soarez <soarez@apple.com>
2021-02-19 15:46:34 -08:00
Ismael Juma 744d05b128
KAFKA-12327: Remove MethodHandle usage in CompressionType (#10123)
We don't really need it and it causes problems in older Android versions
and GraalVM native image usage (there are workarounds for the latter).

Move the logic to separate classes that are only invoked when the
relevant compression library is actually used. Place such classes
in their own package and enforce via checkstyle that only these
classes refer to compression library packages.

To avoid cyclic dependencies, moved `BufferSupplier` to the `utils`
package.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-02-14 08:12:25 -08:00
Ismael Juma 70a36bdacb
MINOR: Update zstd and use classes with no finalizers (#10120)
The updated version includes a few optimizations that benefit us:
* Classes with no finalizers (opt-in) that have better GC behavior
* `InputStream.skip()` implementation that uses cached buffers
* Minor buffer recycler optimizations (used for OutputStream only)

Full diff:
https://github.com/luben/zstd-jni/compare/v1.4.8-2...v1.4.8-4

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-02-13 07:28:17 -08:00
dengziming 3769bc21b5
MINOR: replace hard-coding utf-8 with StandardCharsets.UTF_8 (#10079)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-02-09 10:06:01 +08:00
Colin Patrick McCabe d98df7fc4d
MINOR: Add KafkaEventQueue (#10030)
Add KafkaEventQueue, which is used by the KIP-500 controller to manage its event queue.
Compared to using an Executor, KafkaEventQueue has the following advantages:

* Events can be given "deadlines." If an event lingers in the queue beyond the deadline, it
will be completed with a timeout exception. This is useful for implementing timeouts for
controller RPCs.

* Events can be prepended to the queue as well as appended.

* Events can be given tags to make them easier to manage. This is especially useful for
rescheduling or cancelling events which were previously scheduled to execute in the future.

Reviewers: Jun Rao <junrao@gmail.com>, José Armando García Sancio <jsancio@gmail.com>
2021-02-04 14:46:57 -08:00
Chia-Ping Tsai 3daa348f0d
MINOR: Upgrade to Scala 2.12.13 (#9981)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-01-28 09:02:39 +08:00
Ismael Juma 5cf9cfcaba
MINOR: Update zookeeper to 3.5.9 (#9977)
A few important fixes:
* ZOOKEEPER-3829: Zookeeper refuses request after node expansion
* ZOOKEEPER-3842: Rolling scale up of zookeeper cluster does not work with reconfigEnabled=false
* ZOOKEEPER-3830: After add a new node, zookeeper cluster won't commit any proposal if this new node is leader

Full release notes: https://zookeeper.apache.org/doc/r3.5.9/releasenotes.html

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-27 05:39:02 -08:00
Ismael Juma 24a2ed26a6
MINOR: Update zstd-jni to 1.4.8-2 (#9957)
* The latest version zstd-jni doesn't use `RecyclingBufferPool` by default, so we
pass it via the relevant constructors to maintain the behavior before this
change.
* zstd-jni fixes an issue when using Alpine, see https://github.com/luben/zstd-jni/issues/157.
* zstd 1.4.7 includes several months of improvements across many axis,
from performance to various fixes. Details: https://github.com/facebook/zstd/releases/tag/v1.4.7
* zstd 1.4.8 is a hotfix release, details: https://github.com/facebook/zstd/releases/tag/v1.4.8

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-24 20:20:52 -08:00
Ismael Juma b8a9201280
MINOR: Update to Gradle 6.8.1 (#9953)
A number of regressions were fixed (see "Fixed issues" section):

https://docs.gradle.org/6.8.1/release-notes.html

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-23 15:54:06 -08:00
Ismael Juma 1ca497a7fd
MINOR: Upgrade gradle to 6.8 and test retry plugin to 1.2.0 (#9849)
Also fix generation of `gradlew` when `APP_HOME` contains a directory with spaces
in its name.

Release notes:
* https://docs.gradle.org/6.8/release-notes.html
* https://github.com/gradle/test-retry-gradle-plugin/releases/tag/v1.2.0

In addition to existing tests, verified that `./gradlewAll jar` succeeds.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-18 09:04:20 -08:00
Ismael Juma 6f9e73cfd8
MINOR: Move a few more methods to AuthHelper (#9913)
And move some tests to `AuthHelperTest`.

Reviewers: David Arthur <mumrah@gmail.com>
2021-01-16 06:44:02 -08:00
Mickael Maison 966e9dd6a2
MINOR: Updating files with release 2.6.1 (#9844)
Reviewers: Bill Bejeck <bbejeck@gmail.com>, Matthias J. Sax <mjsax@apache.org>
2021-01-14 12:24:18 +00:00
Bill Bejeck 300909d9e6
MINOR: Updating files with latest release 2.7.0 (#9772)
Changes to trunk for the 2.7.0 release. Updating dependencies.gradle, Dockerfile, and vagrant/bash.sh

Reviewers: Matthias J. Sax <mjsax@apache.org>
2020-12-21 11:52:49 -05:00
Julien Jean Paul Sirocchi f285188f10
MINOR: Update jackson databind to 2.10.5.1 (#9702)
Fixes:
* DOMDeserializer: setExpandEntityReferences(false) may not prevent external entity
expansion in all cases (CVE-2020-25649)

Full details: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.10#micro-patches

Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-12-15 16:26:59 -08:00
Ismael Juma 8cabd57612
MINOR: Update jmh to 1.27 for async profiler support (#9129)
Also updated the jmh readme to make it easier for new people to know
what's possible and best practices.

There were some changes in the generated benchmarking code that
required adjusting `spotbugs-exclude.xml` and for a `javac` warning
to be suppressed for the benchmarking module. I took the chance
to make the spotbugs exclusion mode maintainable via a regex
pattern.

Tested the commands on Linux and macOS with zsh.

JMH highlights:

* async-profiler integration. Can be used with -prof async,
pass -prof async:help to look for the accepted options.
* perf c2c [2] integration. Can be used with -prof perfc2c,
if available.
* JFR profiler integration. Can be used with -prof jfr, pass
-prof jfr:help to look for the accepted options.

Full details:
* 1.24: https://mail.openjdk.java.net/pipermail/jmh-dev/2020-August/002982.html
* 1.25: https://mail.openjdk.java.net/pipermail/jmh-dev/2020-August/002987.html
* 1.26: https://mail.openjdk.java.net/pipermail/jmh-dev/2020-October/003024.html
* 1.27: https://mail.openjdk.java.net/pipermail/jmh-dev/2020-December/003096.html

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Bill Bejeck <bbejeck@gmail.com>, Lucas Bradstreet <lucasbradstreet@gmail.com>
2020-12-10 17:56:52 -08:00
Ismael Juma cbf8ad277a
MINOR: Upgrade to Scala 2.13.4 (#9643)
Scala 2.13.4 restores default global `ExecutionContext` to 2.12 behavior
(to fix a perf regression in some use cases) and improves pattern matching
(especially exhaustiveness checking). Most of the changes are related
to the latter as I have enabled the newly introduced `-Xlint:strict-unsealed-patmat`.

More details on the code changes:
* Don't swallow exception in `ReassignPartitionsCommand.topicDescriptionFutureToState`.
* `RequestChannel.Response` should be `sealed`.
* Introduce sealed ClientQuotaManager.BaseUserEntity to avoid false positive
exhaustiveness warning.
* Handle a number of cases where pattern matches were not exhaustive:
either by marking them with @unchecked or by adding a catch-all clause.
* Workaround scalac bug related to exhaustiveness warnings in ZooKeeperClient
* Remove warning suppression annotations related to the optimizer that are no
longer needed in ConsumerGroupCommand and AclAuthorizer.
* Use `forKeyValue` in `AclAuthorizer.acls` as the scala bug preventing us from
using it seems to be fixed.
* Also update scalaCollectionCompat to 2.3.0, which includes minor improvements.

Full release notes:
* https://github.com/scala/scala/releases/tag/v2.13.4
* https://github.com/scala/scala-collection-compat/releases/tag/v2.3.0

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-11-24 10:28:53 -08:00
Ismael Juma a5986bd32d
MINOR: Update build and test dependencies (#9645)
The spotbugs upgrade means we can re-enable
RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE and RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE.
These uncovered one bug, one unnecessary null check and one
false positive. Addressed them all, including a test for the bug.

* gradle (6.7.0 -> 6.7.1): minor fixes.
* gradle versions plugin (0.29.0 -> 0.36.0): minor fixes.
* grgit (4.0.2 -> 4.1.0): a few small fixes and dependency bumps.
* owasp dependency checker plugin (5.3.2.1 -> 6.0.3): improved db
schema, data and several fixes. 
* scoverage plugin (4.0.2 -> 5.0.0): support Scala 2.13.
* shadow plugin (6.0.0 -> 6.1.0): require Java 8, support for Java 16.
* spotbugs plugin (4.4.4 -> 4.6.0): support SARIF reporting standard.
* spotbugs (4.0.6 -> 4.1.4): support for Java 16 and various fixes including
try with resources false positive.
* spotless plugin (5.1.0 -> 5.8.2): minor fixes.
* test retry plugin (1.1.6 -> 1.1.9): newer gradle and java version compatibility
fixes.
* mockito (3.5.7 -> 3.6.0): minor fixes.
* powermock (2.0.7 -> 2.0.9): minor fixes.

Release notes links:
* https://docs.gradle.org/6.7.1/release-notes.html
* https://github.com/spotbugs/spotbugs/blob/4.1.4/CHANGELOG.md
* https://github.com/scoverage/gradle-scoverage/releases/tag/5.0.0
* https://github.com/johnrengelman/shadow/releases/tag/6.1.0
* https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.6.0
* https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.6.0
* https://github.com/spotbugs/spotbugs-gradle-plugin/releases/tag/4.5.0
* https://github.com/ben-manes/gradle-versions-plugin/releases
* https://github.com/ajoberstar/grgit/releases/tag/4.1.0
* https://github.com/jeremylong/DependencyCheck/blob/main/RELEASE_NOTES.md#version-603-2020-11-03
* https://github.com/powermock/powermock/releases/tag/powermock-2.0.8
* https://github.com/powermock/powermock/releases/tag/powermock-2.0.9
* https://github.com/mockito/mockito/blob/v3.6.0/doc/release-notes/official.md
* https://github.com/gradle/test-retry-gradle-plugin/releases
* https://github.com/diffplug/spotless/blob/main/plugin-gradle/CHANGES.md

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-11-24 06:20:05 -08:00
Ismael Juma 80b81ef9fe
MINOR: Update snappy-java to 1.1.8.1 (#9646)
It includes small performance improvements:
* https://github.com/google/snappy/releases/tag/1.1.8
* https://github.com/xerial/snappy-java/blob/1.1.8.1/Milestone.md

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-11-23 19:31:42 -08:00
Chia-Ping Tsai 6bbf69fb00
KAFKA-10497 Convert group coordinator metadata schemas to use generat… (#9318)
Reviewers: David Jacot <djacot@confluent.io>
2020-11-18 14:49:04 +08:00
James Yuzawa eb24ed893a
KAFKA-10470: Zstd upgrade and buffering (#9499)
Zstd-jni 1.4.5-6 allocates large internal buffers inside of ZstdInputStream and ZstdOutputStream. This caused a lot of allocation and GC activity when creating and closing the streams. It also does not buffer the reads or writes. This causes inefficiency when DefaultRecord.writeTo() does a series of small single bytes reads using various ByteUtils methods. The JNI is more efficient if the writes of uncompressed data were flushed in large pieces rather than for each byte. This is due to the the expense of context switching between the Java code and the native code. This is also the case when reading as well. Per luben/zstd-jni#141 the maintainer of zstd-jni and I agreed to not buffer reads and writes in favor of having the caller do that, so here we are updating the caller.

In this patch, I upgraded to the most recent zstd-jni version with the buffer reuse built-in. This was done in luben/zstd-jni#143 and luben/zstd-jni#146 Since we decided not to add additional buffering of input/output with zstd-jni, I added the BufferedInputStream and BufferedOutputStream to CompressionType.ZSTD just like we currently do for CompressionType.GZIP which also is inefficient for single byte reads and writes. I used the same buffer sizes as that existing implementation.

NOTE: if so desired we could pass a wrapped BufferSupplier into the Zstd*Stream classes to have Kafka decide how the buffer recycling occurs. This functionality was added in the latter PR linked above. I am holding off on this since based on jmh benchmarking the performance gains were not clear and personally I don't know if it worth the complexity of trying to hack around the reflection at this point in time. The zstd-jni uses a very similar default recycler as snappy does currently which seems to provide decent efficiency. While this PR fixes the defect, I feel that using BufferSupplier in both zstd-jni and snappy is outside of the scope of this bugfix and should be considered a separate improvement. I would prefer this change get merged in on its own since the performance gains here are very significant relative to the more incremental and minor optimizations which could be achieved by doing that separate work.

There are some noticeable improvements in the JMH benchmarks (excerpt):

BEFORE:
Benchmark                                                                                                                    (bufferSupplierStr)  (bytes)  (compressionType)  (maxBatchSize)  (messageSize)  (messageVersion)   Mode  Cnt       Score     Error   Units
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed                                                CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   27743.260 ± 673.869   ops/s
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.alloc.rate                                 CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    3399.966 ±  82.608  MB/sec
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.alloc.rate.norm                            CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  134968.010 ±   0.012    B/op
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.churn.G1_Eden_Space                        CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    3850.985 ±  84.476  MB/sec
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.churn.G1_Eden_Space.norm                   CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  152881.128 ± 942.189    B/op
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.churn.G1_Survivor_Space                    CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     174.241 ±   3.486  MB/sec
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.churn.G1_Survivor_Space.norm               CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    6917.758 ±  82.522    B/op
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.count                                      CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    1689.000            counts
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.time                                       CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   82621.000                ms
JMH benchmarks done

Benchmark                                                                                                    (bufferSupplierStr)  (bytes)  (compressionType)  (maxBatchSize)  (messageSize)  (messageVersion)   Mode  Cnt       Score       Error   Units
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage                                                    CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   24095.711 ±   895.866   ops/s
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.alloc.rate                                     CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    2932.289 ±   109.465  MB/sec
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.alloc.rate.norm                                CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  134032.012 ±     0.013    B/op
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Eden_Space                            CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    3282.912 ±   115.042  MB/sec
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Eden_Space.norm                       CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  150073.914 ±  1342.235    B/op
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Survivor_Space                        CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     149.697 ±     5.786  MB/sec
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Survivor_Space.norm                   CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    6842.462 ±    64.515    B/op
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.count                                          CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    1449.000              counts
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.time                                           CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   82518.000                  ms
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize                                                     CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    1449.060 ±   230.498   ops/s
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.alloc.rate                                      CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     198.051 ±    31.532  MB/sec
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.alloc.rate.norm                                 CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  150502.519 ±     0.186    B/op
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.churn.G1_Eden_Space                             CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     200.064 ±    31.879  MB/sec
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.churn.G1_Eden_Space.norm                        CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  152569.341 ± 13826.686    B/op
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.count                                           CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15      91.000              counts
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.time                                            CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   75869.000                  ms
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize                                                CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    2609.660 ±  1145.160   ops/s
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.alloc.rate                                 CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     815.441 ±   357.818  MB/sec
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.alloc.rate.norm                            CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  344309.097 ±     0.238    B/op
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Eden_Space                        CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     808.952 ±   354.975  MB/sec
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Eden_Space.norm                   CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  345712.061 ± 51434.034    B/op
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Old_Gen                           CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       0.019 ±     0.042  MB/sec
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Old_Gen.norm                      CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15      18.615 ±    42.045    B/op
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Survivor_Space                    CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15      24.132 ±    12.254  MB/sec
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Survivor_Space.norm               CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   13540.960 ± 14649.192    B/op
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.count                                      CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     148.000              counts
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.time                                       CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   23848.000                  ms
JMH benchmarks done

AFTER
Benchmark                                                                                                                (bufferSupplierStr)  (bytes)  (compressionType)  (maxBatchSize)  (messageSize)  (messageVersion)   Mode  Cnt       Score      Error   Units
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed                                            CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  147792.454 ± 2721.318   ops/s
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.alloc.rate                             CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    2708.481 ±   50.012  MB/sec
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.alloc.rate.norm                        CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   20184.002 ±    0.002    B/op
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.churn.G1_Eden_Space                    CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    2732.667 ±   59.258  MB/sec
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.churn.G1_Eden_Space.norm               CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   20363.460 ±  120.585    B/op
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.churn.G1_Old_Gen                       CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       0.042 ±    0.033  MB/sec
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.churn.G1_Old_Gen.norm                  CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       0.316 ±    0.249    B/op
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.count                                  CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     833.000             counts
CompressedRecordBatchValidationBenchmark.measureValidateMessagesAndAssignOffsetsCompressed:·gc.time                                   CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    8390.000                 ms
JMH benchmarks done

Benchmark                                                                                                (bufferSupplierStr)  (bytes)  (compressionType)  (maxBatchSize)  (messageSize)  (messageVersion)   Mode  Cnt       Score      Error   Units
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage                                                CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  166786.092 ± 3285.702   ops/s
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.alloc.rate                                 CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    2926.914 ±   57.464  MB/sec
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.alloc.rate.norm                            CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   19328.002 ±    0.002    B/op
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Eden_Space                        CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    2938.541 ±   66.850  MB/sec
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Eden_Space.norm                   CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   19404.357 ±  177.485    B/op
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Old_Gen                           CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       0.516 ±    0.100  MB/sec
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Old_Gen.norm                      CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       3.409 ±    0.657    B/op
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Survivor_Space                    CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       0.032 ±    0.131  MB/sec
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.churn.G1_Survivor_Space.norm               CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       0.207 ±    0.858    B/op
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.count                                      CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     834.000             counts
RecordBatchIterationBenchmark.measureIteratorForBatchWithSingleMessage:·gc.time                                       CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    9370.000                 ms
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize                                                 CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   15988.116 ±  137.427   ops/s
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.alloc.rate                                  CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     448.636 ±    3.851  MB/sec
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.alloc.rate.norm                             CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   30907.698 ±    0.020    B/op
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.churn.G1_Eden_Space                         CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     450.905 ±    5.587  MB/sec
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.churn.G1_Eden_Space.norm                    CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   31064.113 ±  291.190    B/op
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.churn.G1_Old_Gen                            CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       0.043 ±    0.007  MB/sec
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.churn.G1_Old_Gen.norm                       CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       2.931 ±    0.493    B/op
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.count                                       CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     790.000             counts
RecordBatchIterationBenchmark.measureSkipIteratorForVariableBatchSize:·gc.time                                        CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     999.000                 ms
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize                                            CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15   11345.169 ±  206.528   ops/s
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.alloc.rate                             CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    2314.800 ±   42.094  MB/sec
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.alloc.rate.norm                        CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  224714.266 ±    0.028    B/op
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Eden_Space                    CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    2320.213 ±   45.521  MB/sec
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Eden_Space.norm               CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15  225235.965 ±  803.309    B/op
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Old_Gen                       CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       0.026 ±    0.005  MB/sec
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.churn.G1_Old_Gen.norm                  CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15       2.551 ±    0.455    B/op
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.count                                  CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15     994.000             counts
RecordBatchIterationBenchmark.measureStreamingIteratorForVariableBatchSize:·gc.time                                   CREATE   RANDOM               ZSTD             200           1000                 2  thrpt   15    1189.000                 ms
JMH benchmarks done

Reviewers: Ismael Juma <ismael@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2020-11-11 10:11:52 +08:00
Nitesh Mor d61dc0c183 MINOR: Update jetty to 9.4.33
Jetty 9.4.32 and before are affected by CVE-2020-27216. This vulnerability is fixed in Jetty 9.4.33, please see the jetty project security advisory for details: https://github.com/eclipse/jetty.project/security/advisories/GHSA-g3wg-6mcf-8jj6#advisory-comment-63053

Unit tests and integration tests pass locally after the upgrade.

Author: Nitesh Mor <nmor@confluent.io>

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>

Closes #9556 from niteshmor/trunk
2020-11-09 22:14:29 +05:30
Ismael Juma fc4710e2da
MINOR: Fix JDK8 compatibility issue in Snappy (#9460)
See https://github.com/xerial/snappy-java/releases/tag/1.1.7.7 for more details.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-10-20 20:38:24 -07:00
Ismael Juma ebe6595c3d
MINOR: Upgrade to gradle 6.7 (#9440)
This release includes a key fix:
* Zinc leaks its dependencies to user classpath (https://github.com/gradle/gradle/issues/14168)

Release notes:
https://docs.gradle.org/6.7/release-notes.html

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-10-15 07:54:43 -07:00
Ismael Juma ac89e49bf2
MINOR: Use `Map.forKeyValue` to avoid tuple allocation in Scala 2.13 (#9299)
`forKeyValue` invokes `foreachEntry` in Scala 2.13 and falls back to
`foreach` in Scala 2.12.

This change requires a newer version of scala-collection-compat, so
update it to the latest version (2.2.0).

Finally, included a minor clean-up in `GetOffsetShell` to use `toArray`
before `sortBy` since it's more efficient.

Reviewers: Jason Gustafson <jason@confluent.io>, David Jacot <djacot@confluent.io>, José Armando García Sancio <jsancio@users.noreply.github.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-09-21 16:04:19 -07:00
Ismael Juma 96f5502774
MINOR: Update junit to 5.7.0 (#9282)
The final release is now out:
https://junit.org/junit5/docs/5.7.0/release-notes/index.html

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-09-14 07:47:31 -07:00
Ismael Juma 7d0086e0c3
KAFKA-10447: Migrate tools module to JUnit 5 (#9231)
This change sets the groundwork for migrating other modules incrementally.

Main changes:
- Replace `junit` 4.13 with `junit-jupiter` and `junit-vintage` 5.7.0-RC1.
- All modules except for `tools` depend on `junit-vintage`.
- `tools` depends on `junit-jupiter`.
- Convert `tools` tests to JUnit 5.
- Update `PushHttpMetricsReporterTest` to use `mockito` instead of `powermock` and `easymock`
(powermock doesn't seem to work well with JUnit 5 and we don't need it since mockito can mock
static methods).
- Update `mockito` to 3.5.7.
- Update `TestUtils` to use JUnit 5 assertions since `tools` depends on it.

Unrelated clean-ups:
- Remove `unit` from package names in a few `core` tests.
- Replace `try/catch/fail` with `assertThrows` in a number of places.
- Tag `CoordinatorTest` as integration test.
- Remove unnecessary type parameters when invoking methods and constructors.

Tested with IntelliJ and gradle. Verified that the following commands work as expected:
* ./gradlew tools:unitTest
* ./gradlew tools:integrationTest
* ./gradlew tools:test
* ./gradlew core:unitTest
* ./gradlew core:integrationTest
* ./gradlew clients:test

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-09-10 16:14:38 -07:00
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
John Roesler 7159c6ddd0
MINOR: bump 2.5 versions to 2.5.1 (#9165)
Reviewers: Bill Bejeck <bbejeck@apache.org>
2020-08-11 15:18:33 -05:00
Ismael Juma 26d620ec55
MINOR: Upgrade Gradle to 6.6 (#9160)
A couple of important bug fixes affecting Scala compilation are the main driver:
* https://github.com/gradle/gradle/issues/13224
* https://github.com/gradle/gradle/issues/13392

Full release notes for the other improvements:
* https://docs.gradle.org/6.6/release-notes.html

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-08-11 09:22:19 -07:00
Randall Hauch 1112fd4723
KAFKA-10341: Add 2.6.0 to system tests and streams upgrade tests (#9116)
Author: Randall Hauch <rhauch@gmail.com>
Reviewer: Matthias J. Sax <matthias@confluent.io>
2020-08-04 18:04:52 -05:00
Nitesh Mor fcfb71cd50
MINOR: Update jackson to latest 2.10.5 (#9058)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-08-04 12:20:53 -07:00
Ismael Juma 24e76a94f6
MINOR: Update dependencies for Kafka 2.7 (part 1) (#9082)
I left out updates that could be risky. Preliminary testing indicates
we can build (including spotBugs) and run tests with Java 15 with
these changes. I will do more thorough testing once Java 15 reaches
release candidate stage in a few weeks.

Minor updates with mostly bug fixes:
- Scala: 2.12.11 -> 2.12.12 (compiler and collection performance improvements)
- Bouncy castle: 1.64 -> 1.66 (several bug fixes)
- HttpClient: 4.5.11 -> 4.5.12 (small number of bug fixes)
- Mockito: 3.3.3 -> 3.4.4 (several bug fixes and Java 15 support)
- Netty: 4.5.10 -> 4.5.11 (several bug fixes)
- Snappy: 1.1.7.3 -> 1.1.7.6 (small number of bug fixes)
- Zstd: 1.4.5-2 -> 1.4.5-6 (small number of bug fixes)

Gradle plugin and library upgrades:
- Gradle version plugins: 0.28.0 -> 0.29.0 (small number of bug fixes)
- Git: 4.0.1 -> 4.0.2 (small number of bug fixes)
- Scoverage plugin: 4.0.1 -> 4.0.2 (small number of bug fixes)
- Shadow plugin: 5.2.0 -> 6.0.0 (Java 15 support and require Gradle 6.0)
- Test Retry plugin: 1.1.5 -> 1.1.6 (small number of bug fixes)
- Spotless plugin: 4.4.4 -> 5.1.0 (several internal changes that should not matter to us)
- Spotbugs: 4.0.3 -> 4.0.6 (small number of bug fixes)
- Spotbugs plugin: 4.2.4 -> 4.4.4 (small number of bug fixes)

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-07-27 03:47:19 -07:00
Mickael Maison caa806cd82
KAFKA-10232: MirrorMaker2 internal topics Formatters KIP-597 (#8604)
This PR includes 3 MessageFormatters for MirrorMaker2 internal topics:
- HeartbeatFormatter
- CheckpointFormatter
- OffsetSyncFormatter

This also introduces a new public interface org.apache.kafka.common.MessageFormatter that users can implement to build custom formatters.

Reviewers: Konstantine Karantasis <k.karantasis@gmail.com>, Ryanne Dolan <ryannedolan@gmail.com>, David Jacot <djacot@confluent.io>

Co-authored-by: Mickael Maison <mickael.maison@gmail.com>
Co-authored-by: Edoardo Comar <ecomar@uk.ibm.com>
2020-07-03 10:41:45 +01:00
Ismael Juma 5275e4b7ef
MINOR: Update Netty to 4.1.50.Final (#8972)
This includes important fixes. Netty is required by ZooKeeper if TLS is
enabled.

I verified that the netty jars were changed from 4.1.48 to 4.1.50 with
this PR, `find . -name '*netty*'`:

```text
./core/build/dependant-libs-2.13.3/netty-handler-4.1.50.Final.jar
./core/build/dependant-libs-2.13.3/netty-transport-native-epoll-4.1.50.Final.jar
./core/build/dependant-libs-2.13.3/netty-codec-4.1.50.Final.jar
./core/build/dependant-libs-2.13.3/netty-transport-native-unix-common-4.1.50.Final.jar
./core/build/dependant-libs-2.13.3/netty-transport-4.1.50.Final.jar
./core/build/dependant-libs-2.13.3/netty-resolver-4.1.50.Final.jar
./core/build/dependant-libs-2.13.3/netty-buffer-4.1.50.Final.jar
./core/build/dependant-libs-2.13.3/netty-common-4.1.50.Final.jar
```

Note that the previous netty exclude no longer worked since we upgraded
to ZooKeeper 3.5.x as it switched to Netty 4 which has different module names.
Also, the Netty dependency is needed by ZooKeeper for TLS support so we
cannot exclude it.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-07-01 22:36:30 -07:00
leah c4ec765af5
KAFKA-4996: Fix findbugs multithreaded correctness warnings for streams (#8929)
Fix findbugs multithreaded correctness warnings for streams, updated variables to be threadsafe

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Boyang Chen <boyang@confluent.io>, John Roesler <vvcephei@apache.org>
2020-06-30 12:15:28 -05:00
Konstantine Karantasis 2dfb6b05e1
MINOR: Upgrade jetty to 9.4.30.v20200611 (#8893)
Recently, commit 492306a updated both jetty to version 9.4.27.v20200227 and jersey to version 2.31

However in the latest versions of jetty, the renaming of the method `Response#closeOutput` to `Response#completeOutput` has been reverted, with the latest version using again `Response#closeOutput`. 

Jersey has not released a recent version in which `Response#closeOutput` is called directly. In its currently latest version (2.31) `Response#closeOutput` will be called if `Response#completeOutput` throws a `NoSuchMethodError` exception. Given that, this version combination is compatible. Jersey should be upgraded once a new version that uses `Response#closeOutput` directly is out.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-06-29 10:36:12 -07:00
Ismael Juma 7f90a58b69
MINOR: Update Scala to 2.13.3 (#8931)
I had to fix several compiler errors due to deprecation of auto application of `()`. A related
Xlint config (`-Xlint:nullary-override`) is no longer valid in 2.13, so we now only enable it
for 2.12. The compiler flagged two new inliner warnings that required suppression and
the semantics of `&` in `@nowarn` annotations changed, requiring a small change in
one of the warning suppressions.

I also removed the deprecation of a number of methods in `KafkaZkClient` as
they should not have been deprecated in the first place since `KafkaZkClient` is an
internal class and we still use these methods in the Controller and so on. This
became visible because the Scala compiler now respects Java's `@Deprecated`
annotation.

Finally, I included a few minor clean-ups (eg using `toBuffer` instead `toList`) when fixing
the compilation warnings.

Noteworthy bug fixes in Scala 2.13.3:

* Fix 2.13-only bug in Java collection converters that caused some operations to perform an extra pass
* Fix 2.13.2 performance regression in Vector: restore special cases for small operands in appendedAll and prependedAll
* Increase laziness of #:: for LazyList
* Fixes related to annotation parsing of @Deprecated from Java sources in mixed compilation

Full release notes:
https://github.com/scala/scala/releases/tag/v2.13.3

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-06-26 10:19:04 -07:00
Andras Katona 492306a0c5
MINOR: Upgrade jetty to 9.4.27.v20200227 and jersey to 2.31 (#8859)
Upgrade jetty to 9.4.27.v20200227 and jersey to 2.31

Also remove the workaround used on previous versions from Connect's SSLUtils. 
(Reverts KAFKA-9771 - commit ee832d7d)

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chris Egerton <chrise@confluent.io>, Konstantine Karantasis <konstantine@confluent.io>
2020-06-17 09:25:02 -07:00
David Jacot 21362ad7f7
KAFKA-9514; The protocol generator generated useless condition when a field is made nullable and flexible version is used (#8793)
Reviewers: Colin P. McCabe <cmccabe@apache.org>
2020-06-03 17:06:22 -07:00
Ismael Juma 3af3ab9bf9
MINOR: Update to Gradle 6.5 and tweak build jvm config (#8751)
Gradle 6.5 includes a fix for https://github.com/gradle/gradle/pull/12866, which
affects the performance of Scala compilation.

I profiled the scalac build with async profiler and 54% of the time was on GC
even after the Gradle upgrade (it was more than 60% before), so I switched to
the throughput GC (GC latency is less important for batch builds) and it
was reduced to 38%.

I also centralized the jvm configuration in `build.gradle` and simplified it a bit
by removing the minHeapSize configuration from the test tasks.

On my desktop, the time to execute clean builds with no cached Gradle daemon
was reduced from 127 seconds to 97 seconds. With a cached daemon, it was
reduced from 120 seconds to 88 seconds. The performance regression when
we upgraded to Gradle 6.x was 27 seconds with a cached daemon 
(https://github.com/apache/kafka/pull/7677#issuecomment-616271179), so it
should be fixed now.

Gradle 6.4 with no cached daemon:

```
BUILD SUCCESSFUL in 2m 7s
115 actionable tasks: 112 executed, 3 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.15s user 0.12s system 0% cpu 2:08.06 total
```

Gradle 6.4 with cached daemon:

```
BUILD SUCCESSFUL in 2m 0s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  0.95s user 0.10s system 0% cpu 2:01.42 total
```

Gradle 6.5 with no cached daemon:

```
BUILD SUCCESSFUL in 1m 46s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.27s user 0.12s system 1% cpu 1:47.71 total
```

Gradle 6.5 with cached daemon:

```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.02s user 0.10s system 1% cpu 1:38.31 total
```

This PR with no cached Gradle daemon:

```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 81 executed, 34 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.27s user 0.10s system 1% cpu 1:38.70 total
```

This PR with cached Gradle daemon:

```
BUILD SUCCESSFUL in 1m 28s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava  1.02s user 0.10s system 1% cpu 1:29.35 total
```

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-06-03 13:18:50 -07:00
showuon 162884409d
MINOR: Upgrade spotbugs and spotbugsPlugin (#8790)
Upgrade spotbugsPlugin to have clear output indicating where the error is. 

When investigating KAFKA-10081, I found the error output of spotbugs is very poor. It doesn't even tell you where the error is and how many errors found, it will take a lot of time for the developers to find out where the error is, and then fix it.
![image](https://user-images.githubusercontent.com/43372967/83590263-efc42a80-a587-11ea-95cf-e9097d9a662e.png)
https://builds.apache.org/blue/organizations/jenkins/kafka-trunk-jdk8/detail/kafka-trunk-jdk8/4596/pipeline/

Then, I found out there's a bug in spotbugsPlugin in V4.0.x, and got fixed in V4.2.x
https://github.com/spotbugs/spotbugs-gradle-plugin/issues/210

So, after upgrading to V4.2.x (I followed to the latest version V4.2.4), the output is like this:
![image](https://user-images.githubusercontent.com/43372967/83590913-60b81200-a589-11ea-9a04-1449d693c2f2.png)
So you know there's 1 error and you can also open the report file to find out the error.

Upgraded to the latest bug fix release of spotbugs (4.0.3) while at it.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-06-03 13:17:31 -07:00
Ismael Juma d7ce35d61a
MINOR: Update zstd to 1.4.5 (#8766)
It improves decompression speed:

>For x64 cpus, expect a speed bump of at least +5%, and up to +10% in favorable cases.
>ARM cpus receive more benefit, with speed improvements ranging from +15% vicinity,
>and up to +50% for certain SoCs and scenarios (ARM‘s situation is more complex due
>to larger differences in SoC designs).

See https://github.com/facebook/zstd/releases/tag/v1.4.5 for more details.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-05-31 14:58:30 -07:00
Ismael Juma 2d37c8c844
Update Gradle to 6.4.1 (#8678)
This fixes critical bugs in Gradle 6.4:

* Regression: Different daemons are used between IDE and CLI builds for the same project
* Regression: Main-Class attribute always added to jar manifest when using application plugin
* Fix potential NPE if code is executed concurrently

More details: https://github.com/gradle/gradle/releases/tag/v6.4.1

Reviewers: Manikumar Reddy <manikumar@confluent.io>
2020-05-17 11:02:53 -07:00
Ismael Juma 8d3251e57b
KAFKA-9996: Upgrade zookeeper to 3.5.8 (#8674)
It fixes 30 issues, including third party CVE fixes, several leader-election
related fixes and a compatibility issue with applications built against earlier
3.5 client libraries (by restoring a few non public APIs).

See ZooKeeper 3.5.8 Release Notes for details: https://zookeeper.apache.org/doc/r3.5.8/releasenotes.html

Reviewers: Manikumar Reddy <manikumar@confluent.io>
2020-05-15 08:56:00 -07:00
Ismael Juma 1d438033f7
MINOR: Pass `-release 8` to scalac and upgrade to Gradle 6.4 (#8538)
The version of Zinc included with Gradle 6.4 includes a fix for the blocker
that was preventing us from passing `-release 8` to scalac.

Release notes for Gradle 6.4:

https://docs.gradle.org/6.4/release-notes.html

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-05-05 22:20:29 -07:00
Ismael Juma fbfda2c4ad
KAFKA-9731: Disable immediate fetch response for hw propagation if replica selector is not defined (#8607)
In the case described in the JIRA, there was a 50%+ increase in the total fetch request rate in
2.4.0 due to this change.

I included a few additional clean-ups:
* Simplify `findPreferredReadReplica` and avoid unnecessary collection copies.
* Use `LongSupplier` instead of `Supplier<Long>` in `SubscriptionState` to avoid unnecessary boxing.

Added a unit test to ReplicaManagerTest and cleaned up the test class a bit including
consistent usage of Time in MockTimer and other components.

Reviewers: Gwen Shapira <gwen@confluent.io>, David Arthur <mumrah@gmail.com>, Jason Gustafson <jason@confluent.io>
2020-05-04 21:38:53 -07:00
Ismael Juma c5ae154a3f
MINOR: Enable fatal warnings with scala 2.13 (#8429)
* Upgrade to Scala 2.13.2 which introduces the ability to suppress warnings.
* Upgrade to scala-collection-compat 2.1.6 as it introduces the
@nowarn annotation for Scala 2.12.
* While at it, also update scala-java8-compat to 0.9.1.
* Fix compiler warnings and add @nowarn for the unfixed ones.

Scala 2.13.2 highlights (besides @nowarn):

* Rewrite Vector (using "radix-balanced finger tree vectors"),
for performance. Small vectors are now more compactly
represented. Some operations are now drastically faster on
large vectors. A few operations may be a little slower.
* Matching strings makes switches in bytecode.

https://github.com/scala/scala/releases/tag/v2.13.2

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-04-23 00:44:03 -07:00
Ismael Juma 065415e524
MINOR: Upgrade gradle plugins and test libraries for Java 14 support (#8519)
Also:
* Remove deprecated `=` in resolutionStrategy.
* Replace `AES/GCM/PKCS5Padding` with `AES/GCM/NoPadding`
in `PasswordEncoderTest`. The former is invalid and JDK 14 rejects it,
see https://bugs.openjdk.java.net/browse/JDK-8229043.

With these changes, the build works with Java 14 and Scala 2.12. The
same will apply to Scala 2.13 when Scala 2.13.2 is released (should
happen within 1-2 weeks).

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2020-04-20 13:55:20 -07:00
Ismael Juma d6da0452b6
MINOR: Update to Gradle 6.3 (#7677)
* Introduce `gradlewAll` script to replace `*All` tasks since the approach
used by the latter doesn't work since Gradle 6.0 and it's unclear when,
if ever, it will work again ( see https://github.com/gradle/gradle/issues/11301).
* Update release script and README given the above.
* Update zinc to 1.3.5.
* Update gradle-versions-plugin to 0.28.0.

The major improvements in Gradle 6.0 to 6.3 are:
- Improved incremental compilation for Scala
- Support for Java 14 (although some Gradle plugins
like spotBugs may need to be updated or disabled,
will do that separately)
- Improved scalac reporting, warnings are clearly
marked as such, which is very helpful.

Tested `gradlewAll` manually for the commands listed in the README
and release script. For `uploadArchive`, I tested it with a local Maven
repository.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2020-04-19 19:24:21 -07:00
Boyang Chen df41713d64
KAFKA-9779: Add Stream system test for 2.5 release (#8378)
Reviewer: Matthias J. Sax <matthias@confluent.io>
2020-04-15 15:59:03 -07:00
Ismael Juma 90bbeedf52
MINOR: Fix Scala 2.13 compiler warnings (#8390)
Once Scala 2.13.2 is officially released, I will submit a follow up PR
that enables `-Xfatal-warnings` with the necessary warning
exclusions. Compiler warning exclusions were only introduced in 2.13.2
and hence why we have to wait for that. I used a snapshot build to
test it in the meantime.

Changes:
* Remove Deprecated annotation from internal request classes
* Class.newInstance is deprecated in favor of
Class.getConstructor().newInstance
* Replace deprecated JavaConversions with CollectionConverters
* Remove unused kafka.cluster.Cluster
* Don't use Map and Set methods deprecated in 2.13:
    - collection.Map +, ++, -, --, mapValues, filterKeys, retain
    - collection.Set +, ++, -, --
* Add scala-collection-compat dependency to streams-scala and
update version to 2.1.4.
* Replace usages of deprecated Either.get and Either.right
* Replace usage of deprecated Integer(String) constructor
* `import scala.language.implicitConversions` is not needed in Scala 2.13
* Replace usage of deprecated `toIterator`, `Traversable`, `seq`,
`reverseMap`, `hasDefiniteSize`
* Replace usage of deprecated alterConfigs with incrementalAlterConfigs
where possible
* Fix implicit widening conversions from Long/Int to Double/Float
* Avoid implicit conversions to String
* Eliminate usage of deprecated procedure syntax
* Remove `println`in `LogValidatorTest` instead of fixing the compiler
warning since tests should not `println`.
* Eliminate implicit conversion from Array to Seq
* Remove unnecessary usage of 3 argument assertEquals
* Replace `toStream` with `iterator`
* Do not use deprecated SaslConfigs.DEFAULT_SASL_ENABLED_MECHANISMS
* Replace StringBuilder.newBuilder with new StringBuilder
* Rename AclBuffers to AclSeqs and remove usage of `filterKeys`
* More consistent usage of Set/Map in Controller classes: this also fixes
deprecated warnings with Scala 2.13
* Add spotBugs exclusion for inliner artifact in KafkaApis with Scala 2.12.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-04-01 06:20:48 -07:00
Bill Bejeck c725c2338b
MINOR: Update dependencies.gradle, Dockerfile, version.py, and bash.sh for 2.4.1 upgrade (#8387)
These files were missed in the 2.4.1 release

Reviewers: Ismael Juma <ismael@confluent.io>
2020-03-30 12:55:35 -04:00
Gardner Vickers 8cf781ef01
MINOR: Improve performance of checkpointHighWatermarks, patch 1/2 (#6741)
This PR works to improve high watermark checkpointing performance.

`ReplicaManager.checkpointHighWatermarks()` was found to be a major contributor to GC pressure, especially on Kafka clusters with high partition counts and low throughput.

Added a JMH benchmark for `checkpointHighWatermarks` which establishes a
performance baseline. The parameterized benchmark was run with 100, 1000 and
2000 topics. 

Modified `ReplicaManager.checkpointHighWatermarks()` to avoid extra copies and cached
the Log parent directory Sting to avoid frequent allocations when calculating
`File.getParent()`.

A few clean-ups:
* Changed all usages of Log.dir.getParent to Log.parentDir and Log.dir.getParentFile to
Log.parentDirFile.
* Only expose public accessor for `Log.dir` (consistent with `Log.parentDir`)
* Removed unused parameters in `Partition.makeLeader`, `Partition.makeFollower` and `Partition.createLogIfNotExists`.

Benchmark results:

| Topic Count | Ops/ms | MB/sec allocated |
|-------------|---------|------------------|
| 100               | + 51%    |  - 91% |
| 1000             | + 143% |  - 49% |
| 2000            | + 149% |   - 50% |

Reviewers: Lucas Bradstreet <lucas@confluent.io>. Ismael Juma <ismael@juma.me.uk>

Co-authored-by: Gardner Vickers <gardner@vickers.me>
Co-authored-by: Ismael Juma <ismael@juma.me.uk>
2020-03-25 20:53:42 -07:00
jiameixie 11e6aedff6
MINOR: Bump RocksDB version from 5.18.3 to 5.18.4 (#8284)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2020-03-19 15:50:23 -07:00
Ismael Juma 93f082e093
MINOR: Update Scala to 2.12.11 (#8308)
Highlights:
* Performance improvements in the ollections
library: algorithmic improvements and
changes to avoid unnecessary allocations.
* Performance improvements in the compiler.
* ASM was upgraded to 7.3.1, allowing the
optimizer to run on JDK 13+.

Full release notes: https://github.com/scala/scala/releases/tag/v2.12.11

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-03-18 09:33:14 -07:00
Manikumar Reddy a0e1407820
KAFKA-9670; Reduce allocations in Metadata Response preparation (#8236)
This PR removes  intermediate  conversions between `MetadataResponse.TopicMetadata` => `MetadataResponseTopic` and `MetadataResponse.PartitionMetadata` => `MetadataResponsePartition` objects.

There is 15-20% reduction in object allocations and 5-10% improvement in metadata request performance.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson<jason@confluent.io>
2020-03-16 09:30:48 -07:00
Manikumar Reddy 8dff0b168a Kafka 9626: Improve ACLAuthorizer.acls() performance
This PR avoids creation of unnecessary sets in AclAuthorizer.acls() method implementation.

Perf results:
**Old**
```
Benchmark                                (aclCount)  (resourceCount)  Mode  Cnt    Score   Error  Units
AclAuthorizerBenchmark.testAclsIterator           5             5000  avgt   15    5.821 ? 0.309  ms/op
AclAuthorizerBenchmark.testAclsIterator           5            10000  avgt   15   15.303 ? 0.107  ms/op
AclAuthorizerBenchmark.testAclsIterator           5            50000  avgt   15   74.976 ? 0.543  ms/op
AclAuthorizerBenchmark.testAclsIterator          10             5000  avgt   15   15.366 ? 0.184  ms/op
AclAuthorizerBenchmark.testAclsIterator          10            10000  avgt   15   29.899 ? 0.129  ms/op
AclAuthorizerBenchmark.testAclsIterator          10            50000  avgt   15  167.301 ? 1.723  ms/op
AclAuthorizerBenchmark.testAclsIterator          15             5000  avgt   15   21.980 ? 0.114  ms/op
AclAuthorizerBenchmark.testAclsIterator          15            10000  avgt   15   44.385 ? 0.255  ms/op
AclAuthorizerBenchmark.testAclsIterator          15            50000  avgt   15  241.919 ? 3.955  ms/op
```
**New**

```
Benchmark                                (aclCount)  (resourceCount)  Mode  Cnt   Score   Error  Units
AclAuthorizerBenchmark.testAclsIterator           5             5000  avgt   15   0.666 ? 0.004  ms/op
AclAuthorizerBenchmark.testAclsIterator           5            10000  avgt   15   1.427 ? 0.015  ms/op
AclAuthorizerBenchmark.testAclsIterator           5            50000  avgt   15  21.410 ? 0.225  ms/op
AclAuthorizerBenchmark.testAclsIterator          10             5000  avgt   15   1.230 ? 0.018  ms/op
AclAuthorizerBenchmark.testAclsIterator          10            10000  avgt   15   4.303 ? 0.744  ms/op
AclAuthorizerBenchmark.testAclsIterator          10            50000  avgt   15  36.724 ? 0.409  ms/op
AclAuthorizerBenchmark.testAclsIterator          15             5000  avgt   15   2.433 ? 0.379  ms/op
AclAuthorizerBenchmark.testAclsIterator          15            10000  avgt   15   9.818 ? 0.214  ms/op
AclAuthorizerBenchmark.testAclsIterator          15            50000  avgt   15  52.886 ? 0.525  ms/op
```

Author: Manikumar Reddy <manikumar.reddy@gmail.com>
Author: Lucas Bradstreet <lucas@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Rajini Sivaram <rajinisivaram@googlemail.com>, Lucas Bradstreet <lucas@confluent.io>

Closes #8199 from omkreddy/KAFKA-9626
2020-03-03 01:51:09 +05:30
Ismael Juma 52f36d1987
MINOR: Revert Jetty to 9.4.25 (#8183)
9.4.25 renamed closeOutput to completeOutput
(c5acf96506),
which is a method used by recent Jersey versions including the
latest (2.30.1). An example of the error:

> java.lang.NoSuchMethodError: org.eclipse.jetty.server.Response.closeOutput()V
> 	at org.glassfish.jersey.jetty.JettyHttpContainer$ResponseWriter.commit(JettyHttpContainer.java:326)

The request still completes and hence why no test fails. We should think about how
to improve the testing for this kind of problem, but I want to get the fix in before
2.5 RC0.

Credit to @rigelbm for finding this.

Reviewers: Ewen Cheslack-Postava <me@ewencp.org>, Andrew Choi <a24choi@edu.uwaterloo.ca>
2020-02-27 13:06:43 -08:00
Ismael Juma 2c0c2c595b
KAFKA-9515: Upgrade ZooKeeper to 3.5.7 (#8125)
A couple of critical fixes:

ZOOKEEPER-3644: Data loss after upgrading standalone ZK server 3.4.14 to 3.5.6 with snapshot.trust.empty=true
ZOOKEEPER-3701: Split brain on log disk full (3.5) 

Full release notes:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310801&version=12346098

Reviewers: Bill Bejeck <bbejeck@gmail.com>
2020-02-17 07:51:26 -08:00
Viktor Somogyi 987f0eeb31
KAFKA-8164: Add support for retrying failed (#8019)
Disabled by default, but enabled for Jenkins PR builds (maximum of 1 retry per
test with up to 5 retries for the test run).

Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-02-05 16:41:28 -08:00
David Jacot 96c4ce4803
KAFKA-9437; Make the Kafka Protocol Friendlier with L7 Proxies [KIP-559] (#7994)
This PR implements the KIP-559: https://cwiki.apache.org/confluence/display/KAFKA/KIP-559%3A+Make+the+Kafka+Protocol+Friendlier+with+L7+Proxies
- it adds the Protocol Type and the Protocol Name fields in JoinGroup and SyncGroup API;
- it validates that the fields are provided by the client when the new version of the API is used and ensure that they are consistent. it errors out otherwise;
- it validates that the fields are consistent in the client and errors out otherwise;
- it adds many tests related to the API changes but also extends the testing coverage of the requests/responses themselves.
- it standardises the naming in the coordinator. now, `ProtocolType` and `ProtocolName` are used across the board in the coordinator instead of having a mix of protocol type, protocol name, subprotocol, protocol, etc.

Reviewers: Jason Gustafson <jason@confluent.io>
2020-01-31 13:54:07 -08:00
Ismael Juma ef23b432f1
MINOR: Update lz4, jetty and other minor dependency bumps (#8008)
* lz4: fixes identified by oss-fuzz
* jetty: fixes a few recent regressions
* powermock: better support for Java 12+
* zstd-jni: minor fixes
* httpclient: minor fixes
* spotless-plugin: minor fixes
* jmh: minor fixes

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
2020-01-28 05:19:56 -08:00
Ismael Juma a024e679c7
MINOR: Update dependencies for Kafka 2.5 (#7909)
Noteworthy:
* zstd decompression speed improvement of ~10%:
https://github.com/facebook/zstd/releases/tag/v1.4.4
* EasyMock, PowerMock and Mockito: improved support for Java 13.
* Replace usage of method deprecated by Mockito.
* Gradle plugins updated to versions that require Gradle 5.x, this is
fine since we no longer depend on the installed Gradle version.
* Fixed build not to depend on methods deprecated in Gradle 5.x
(fixes KAFKA-8786).
* Reflections 0.9.12 no longer depends on Guava (fixes KAFKA-3061).
* Updated `OptimizedKTableIntegrationTest` to pass with new version
of Hamcrest.
* Several Jetty improvements and bug fixes:
   - https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.21.v20190926
   - https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.22.v20191022
   - https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.23.v20191118
   - https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.24.v20191120
   - https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.25.v20191220

Note that I did not upgrade lz4 due to https://github.com/lz4/lz4-java/issues/156.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>

Co-authored-by: Ismael Juma <ismael@juma.me.uk>
Co-authored-by: Aljoscha <aljoscha.poertner@posteo.de>
2020-01-08 16:25:20 -08:00
Ismael Juma 6dc6f6a60d
KAFKA-9324: Drop support for Scala 2.11 (KIP-531) (#7859)
* Adjust build and documentation.
* Use lambda syntax for SAM types in `core`, `streams-scala` and
`connect-runtime` modules.
* Remove `runnable` and `newThread` from `CoreUtils` as lambda
syntax for SAM types make them unnecessary.
* Remove stale comment in `FunctionsCompatConversions`,
`KGroupedStream`, `KGroupedTable' and `KStream` about Scala 2.11,
the conversions are needed for Scala 2.12 too.
* Deprecate `org.apache.kafka.streams.scala.kstream.Suppressed`
and use `org.apache.kafka.streams.kstream.Suppressed` instead.
* Use `Admin.create` instead of `AdminClient.create`. Static methods
in Java interfaces can be invoked since Scala 2.12. I noticed that
MirrorMaker 2 uses `AdminClient.create`, but I did not change them
as Connectors have restrictions on newer client APIs.
* Improve efficiency in a few `Gauge` implementations by avoiding
unnecessary intermediate collections.
* Remove pointless `Option.apply` in `ZookeeperClient`
`SessionState` metric.
* Fix unused import/variable and other compiler warnings.
* Reduce visibility of some vals/defs.

Reviewers: Manikumar Reddy <manikumar@confluent.io>, Guozhang Wang <wangguoz@gmail.com>, Gwen Shapira <gwen@confluent.io>
2020-01-06 19:51:01 +01:00
Bruno Cadonna 1d21cf166a KAFKA-9305: Add version 2.4 to Streams system tests (#7841)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2019-12-20 14:21:12 -08:00
Randall Hauch ccded348eb
MINOR: Bump system test version from 2.2.1 to 2.2.2 (#7765)
Author: Randall Hauch <rhauch@gmail.com>
Reviewer: Ismael Juma <ismael@confluent.io>
2019-12-06 15:44:56 -06:00
Ismael Juma 45842a3962
MINOR: Remove unnecessary license generation code in wrapper.gradle (#7742)
Newer versions of Gradle handle this automatically. Tested with Gradle 5.6.

Credit to @granthenke for the tip.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-11-24 10:51:49 -08:00
Grant Henke 09f700ab3e KAFKA-1714: Fix gradle wrapper bootstrapping (#6031)
Given we need to follow the Apache rule of not checking
any binaries into the source code, Kafka has always had
a bit of a tricky Gradle bootstrap.
Using ./gradlew as users expect doesn’t work and a
local and compatible version of Gradle was required to
generate the wrapper first.

This patch changes the behavior of the wrapper task to
instead generate a gradlew script that can bootstrap the
jar itself. Additionally it adds a license, removes the bat
script, and handles retries.

The documentation in the readme was also updated.

Going forward patches that upgrade gradle should run
`gradle wrapper` before checking in the change.

With this change users using ./gradlew can be sure they
are always building with the correct version of Gradle.

Reviewers: Viktor Somogyi <viktorsomogyi@gmail.com>, Ismael Juma <ismael@juma.me.uk
2019-11-21 08:06:06 -08:00
John Roesler 4a5155c934 KAFKA-8868: Generate SubscriptionInfo protocol message (#7248)
Rather than maintain hand coded protocol serialization code, Streams could use the same code-generation framework as Clients/Core.

There isn't a perfect match, since the code generation framework includes an assumption that you're generating "protocol messages", rather than just arbitrary blobs, but I think it's close enough to justify using it, and improving it over time.

Using the code generation allows us to drop a lot of detail-oriented, brittle, and hard-to-maintain serialization logic in favor of a schema spec.

Reviewers: Colin P. McCabe <cmccabe@apache.org>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-11-01 10:03:55 -07:00
Ismael Juma baaccbb018
MINOR: Upgrade zk to 3.5.6 (#7544)
It includes an important fix for people running on k8s:

* ZOOKEEPER-3320: Leader election port stop listen when
hostname unresolvable for some time

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-10-17 09:59:02 -07:00
Lucas Bradstreet 8966d066bd KAFKA-9039: Optimize ReplicaFetcher fetch path (#7443)
Improves the performance of the replica fetcher for high partition count fetch requests, where a majority of the partitions did not update between fetch requests. All benchmarks were run on an r5x.large.

Vanilla
Benchmark (partitionCount) Mode Cnt Score Error Units
ReplicaFetcherThreadBenchmark.testFetcher 100 avgt 15 26491.825 ± 438.463 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 500 avgt 15 153941.952 ± 4337.073 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 1000 avgt 15 339868.602 ± 4201.462 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 5000 avgt 15 2588878.448 ± 22172.482 ns/op

From 100 to 5000 partitions the latency increase is 2588878.448 / 26491.825 = 97.

Avoid gettimeofdaycalls in steady state fetch states
8545888

Benchmark (partitionCount) Mode Cnt Score Error Units
ReplicaFetcherThreadBenchmark.testFetcher 100 avgt 15 22685.381 ± 267.727 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 500 avgt 15 113622.521 ± 1854.254 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 1000 avgt 15 273698.740 ± 9269.554 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 5000 avgt 15 2189223.207 ± 1706.945 ns/op

From 100 to 5000 partitions the latency increase is 2189223.207 / 22685.381 = 97X

Avoid copying partition states to maintain fetch offsets
29fdd60

Benchmark (partitionCount) Mode Cnt Score Error Units
ReplicaFetcherThreadBenchmark.testFetcher 100 avgt 15 17039.989 ± 609.355 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 500 avgt 15 99371.086 ± 1833.256 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 1000 avgt 15 216071.333 ± 3714.147 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 5000 avgt 15 2035678.223 ± 5195.232 ns/op

From 100 to 5000 partitions the latency increase is 2035678.223 / 17039.989 = 119X

Keep lag alongside PartitionFetchState to avoid expensive isReplicaInSync check
0e57e3e

Benchmark (partitionCount) Mode Cnt Score Error Units
ReplicaFetcherThreadBenchmark.testFetcher 100 avgt 15 15131.684 ± 382.088 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 500 avgt 15 86813.843 ± 3346.385 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 1000 avgt 15 193050.381 ± 3281.833 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 5000 avgt 15 1801488.513 ± 2756.355 ns/op

From 100 to 5000 partitions the latency increase is 1801488.513 / 15131.684 = 119X

Fetch session optimizations (mostly presizing the next hashmap, and avoiding making a copy of sessionPartitions, as a deep copy is not required for the ReplicaFetcher)
2614b24

Benchmark (partitionCount) Mode Cnt Score Error Units
ReplicaFetcherThreadBenchmark.testFetcher 100 avgt 15 11386.203 ± 416.701 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 500 avgt 15 60820.292 ± 3163.001 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 1000 avgt 15 146242.158 ± 1937.254 ns/op
ReplicaFetcherThreadBenchmark.testFetcher 5000 avgt 15 1366768.926 ± 3305.712 ns/op

From 100 to 5000 partitions the latency increase is 1366768.926 / 11386.203 = 120

Reviewers: Jun Rao <junrao@gmail.com>, Guozhang Wang <wangguoz@gmail.com>
2019-10-16 09:49:53 -07:00
Ismael Juma 32a3dc8f5f
KAFKA-8991: Enable scalac optimizer (#7452)
The scalac optimizer is able to inline methods to avoid lambda allocations, eliminating
the runtime cost of higher order functions in many cases. The compilation parameters
we are using here were introduced in 2.12.x, so we don't enable them for Scala 2.11.
Also, we enable a more aggressive inlining policy for the `core` project since it's
not meant to be used as a library.

See https://www.lightbend.com/blog/scala-inliner-optimizer for more information about
the optimizer.

I verified that the lambda allocation in the code below (from LogCleaner.scala) went away
after this change with Scala 2.12 and 2.13.

```scala
private def consumeAbortedTxnsUpTo(offset: Long): Unit = {
  while (abortedTransactions.headOption.exists(_.firstOffset <= offset)) {
    val abortedTxn = abortedTransactions.dequeue()
    ongoingAbortedTxns.getOrElseUpdate(abortedTxn.producerId, new AbortedTransactionMetadata(abortedTxn))
  }
}
```

The relevant part of the bytecode when compiled with Scala 2.13 looks like:

```text
private void consumeAbortedTxnsUpTo(long);
    Code:
       0: aload_0
       1: invokespecial #54                 // Method abortedTransactions:()Lscala/collection/mutable/PriorityQueue;
       4: invokevirtual #175                // Method scala/collection/mutable/PriorityQueue.headOption:()Lscala/Option;
       7: dup
       8: ifnonnull     13
      11: aconst_null
      12: athrow
      13: astore        4
      15: aload         4
      17: invokevirtual #145                // Method scala/Option.isEmpty:()Z
      20: ifne          48
      23: aload         4
      25: invokevirtual #148                // Method scala/Option.get:()Ljava/lang/Object;
      28: checkcast     #177                // class kafka/log/AbortedTxn
```

The increased inlining causes some spurious spotBugs warnings, I added a few suppressions
and fixed one warning by avoiding unnecessary boxing.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2019-10-09 09:39:24 -07:00
Ismael Juma 9aa660786e
MINOR: Update Jackson to 2.10.0 (#7411)
Guava hasn't been upgraded due to potential incompatibility with the reflections
library:

https://github.com/ronmamo/reflections/issues/194

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-09-29 08:53:41 -07:00
Guozhang Wang a0470726c4 MINOR: Move Murmur3 to Streams 2019-09-19 16:38:18 -07:00
Adam Bellemare 2d0cd2ef54 MINOR: Murmur3 Hash with Guava dependency
Part of supporting KIP-213 ( https://cwiki.apache.org/confluence/display/KAFKA/KIP-213+Support+non-key+joining+in+KTable ). Murmur3 hash is used as a hashing mechanism in KIP-213 for the large range of uniqueness. The Murmur3 class and tests are ported directly from Apache Hive, with no alterations to the code or dependencies.

Author: Adam Bellemare <adam.bellemare@wishabi.com>

Reviewers: John Roesler <vvcephei@users.noreply.github.com>, Ismael Juma <ismael@juma.me.uk>, Guozhang Wang <wangguoz@gmail.com>

Closes #7271 from bellemare/murmur3hash
2019-09-19 15:36:32 -07:00
Ismael Juma f718c5e1e1
MINOR: Update dependencies for Kafka 2.4 (part 2) (#7333)
Upgrade to Gradle 5.6.2 as a step towards Gradle 6.0 (necessary
for Java 13 support).

https://docs.gradle.org/5.5.1/release-notes.html
https://docs.gradle.org/5.6.2/release-notes.html

The other updates are mostly bug fixes:

* Scala 2.13.1: https://github.com/scala/scala/releases/tag/v2.13.1
* Scala 2.12.10: https://github.com/scala/scala/releases/tag/v2.12.10
* Jetty 9.4.20: https://www.eclipse.org/lists/jetty-announce/msg00133.html
* SLF4J 1.7.28: adds Automatic-Module-Name in MANIFEST.MF
* Bouncy castle 1.63: https://www.bouncycastle.org/releasenotes.html
* zstd 1.4.3: https://github.com/facebook/zstd/releases/tag/v1.4.3

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-09-18 12:51:47 -07:00
Lucas Bradstreet f3ded39a05 KAFKA-8841; Reduce overhead of ReplicaManager.updateFollowerFetchState (#7324)
This PR makes two changes to code in the ReplicaManager.updateFollowerFetchState path, which is in the hot path for follower fetches. Although calling ReplicaManager.updateFollowerFetch state is inexpensive on its own, it is called once for each partition every time a follower fetch occurs.

1. updateFollowerFetchState no longer calls maybeExpandIsr when the follower is already in the ISR. This avoid repeated expansion checks. 
2. Partition.maybeIncrementLeaderHW is also in the hot path for ReplicaManager.updateFollowerFetchState. Partition.maybeIncrementLeaderHW calls Partition.remoteReplicas four times each iteration, and it performs a toSet conversion. maybeIncrementLeaderHW now avoids generating any intermediate collections when updating the HWM.

**Benchmark results for Partition.updateFollowerFetchState on a r5.xlarge:**
Old:
```
  1288.633 ±(99.9%) 1.170 ns/op [Average]
  (min, avg, max) = (1287.343, 1288.633, 1290.398), stdev = 1.037
  CI (99.9%): [1287.463, 1289.802] (assumes normal distribution)
```

New (when follower fetch offset is updated):
```
  261.727 ±(99.9%) 0.122 ns/op [Average]
  (min, avg, max) = (261.565, 261.727, 261.937), stdev = 0.114
  CI (99.9%): [261.605, 261.848] (assumes normal distribution)
```

New (when follower fetch offset is the same):
```
  68.484 ±(99.9%) 0.025 ns/op [Average]
  (min, avg, max) = (68.446, 68.484, 68.520), stdev = 0.023
  CI (99.9%): [68.460, 68.509] (assumes normal distribution)
```

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
2019-09-18 09:11:39 -07:00
Matthias J. Sax 4d1ee26a13
KAFKA-8594: Add version 2.3 to Streams system tests (#7131)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>
2019-08-21 10:26:57 -07:00
Matthias J. Sax e9a35fe02e
MINOR: Bump system test version from 2.2.0 to 2.2.1 (#6873)
Reviewers: Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>
2019-08-09 14:33:20 -07:00
Ismael Juma 66d81a0e50
MINOR: Update dependencies for Kafka 2.4 (#7126)
Scala 2.12.9 brings another 5% ~ 10% improvement in compiler performance,
improved compatibility with JDK 11/12/13, and experimental infrastructure for
build pipelining.

zstd update includes performance improvements, among which the
primary improvement is that decompression is ~7% faster.

Level | v1.4.0 | v1.4.1 | Delta
-- | -- | -- | --
1 | 1390 MB/s | 1453 MB/s | +4.5%
3 | 1208 MB/s | 1301 MB/s | +7.6%
5 | 1129 MB/s | 1233 MB/s | +9.2%
7 | 1224 MB/s | 1347 MB/s | +10.0%
16 | 1278 MB/s | 1430 MB/s | +11.8%

Jetty 9.4.19 includes a number of bug fixes:
https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.19.v20190610

Mockito 3.0.0 switched the Java requirement from 7 to 8.

Several updates to owaspDepCheckPlugin (4.0.2 -> 5.2.1).

The rest are patch updates.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
2019-08-08 06:01:22 -07:00
Ismael Juma 97b731b086
MINOR: Upgrade jackson-databind to 2.9.9.3 (#7125)
2.9.9.1 and 2.9.9.2 include security fixes while 2.9.9.3 fixes a regression
introduced in 2.9.9.2.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-08-06 23:01:10 -07:00
Ismael Juma d67495d6a7
KAFKA-8634: Update ZooKeeper to 3.5.5 (#6802)
ZooKeeper 3.5.5 is the first stable release in the 3.5.x series. The key new feature
in is TLS support, but there are a few more noteworthy features:

* Dynamic reconfiguration
* Local sessions
* New node types: Container, TTL
* Ability to remove watchers
* Multi-threaded commit processor
* Upgraded to Netty 4.1

See the release notes for more detail:
https://zookeeper.apache.org/doc/r3.5.5/releasenotes.html

In addition to the version bump, we:

* Add `commons-cli` dependency as it's required by `ZooKeeperMain`, but specified as
`provided` in their pom.
* Remove unnecessary `ZooKeeperMainWrapper`, the bug it worked around was fixed
upstream a long time ago.
* Ignore non zero exit in one system test invocation of `ZooKeeperMain`.
`ZooKeeperMainWrapper` always returned `0` and `ZooKeeperService.query` relies
on that for correct behavior.

Reviewers: Jason Gustafson <jason@confluent.io>
2019-07-10 09:45:10 -07:00
Ismael Juma 57903be496
MINOR: Remove zkclient dependency (#7036)
ZkUtils was removed so we don't need this anymore.

Also:
* Fix ZkSecurityMigrator and ReplicaManagerTest not to
reference ZkClient classes.
* Remove references to zkclient in various `log4j.properties`
and `import-control.xml`.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Stanislav Kozlovski <stanislav_kozlovski@outlook.com>
2019-07-05 07:50:32 -07:00
Ismael Juma 6dd4ebcea7
MINOR: Make the build compile with Scala 2.13 (#6989)
Scala 2.13 support was added to build via #5454. This PR adjusts the code so that
it compiles with 2.11, 2.12 and 2.13.

Changes:
* Add `scala-collection-compat` dependency.
* Import `scala.collection.Seq` in a number of places for consistent behavior between
Scala 2.11, 2.12 and 2.13.
* Remove wildcard imports that were causing the Java classes to have priority over the
Scala ones, related Scala issue: https://github.com/scala/scala/pull/6589.
* Replace parallel collection usage with `Future`. The former is no longer included by
default in the standard library.
* Replace val _: Unit workaround with one that is more concise and works with Scala 2.13
* Replace `filterKeys` with `filter` when we expect a `Map`. `filterKeys` returns a view
that doesn't implement the `Map` trait in Scala 2.13.
* Replace `mapValues` with `map` or add a `toMap` as an additional transformation
when we expect a `Map`. `mapValues` returns a view that doesn't implement the
`Map` trait in Scala 2.13.
* Replace `breakOut` with `iterator` and `to`, `breakOut` was removed in Scala
2.13.
* Replace to() with toMap, toIndexedSeq and toSet
* Replace `mutable.Buffer.--` with `filterNot`.
* ControlException is an abstract class in Scala 2.13.
* Variable arguments can only receive arrays or immutable.Seq in Scala 2.13.
* Use `Factory` instead of `CanBuildFrom` in DecodeJson. `CanBuildFrom` behaves
a bit differently in Scala 2.13 and it's been deprecated. `Factory` has the behavior
we need and it's available via the compat library.
* Fix failing tests due to behavior change in Scala 2.13,
"Map.values.map is not strict in Scala 2.13" (https://github.com/scala/bug/issues/11589).
* Use Java collections instead of Scala ones in StreamResetter (a Java class).
* Adjust CheckpointFile.write to take an `Iterable` instead of `Seq` to avoid
unnecessary collection copies.
* Fix DelayedElectLeader to use a Map instead of Set and avoid `to` call that
doesn't work in Scala 2.13.
* Use unordered map for mapping in SimpleAclAuthorizer, mapping of ordered
maps require an `Ordering` in Scala 2.13 for safety reasons.
* Adapt `ConsumerGroupCommand` to compile with Scala 2.13.
* CoreUtils.min takes an `Iterable` instead of `TraversableOnce`, the latter does
not exist in Scala 2.13.
* Replace `Unit` with `()` in a couple places. Scala 2.13 is stricter when it expects
a value instead of a type.
* Fix bug in CustomQuotaCallbackTest where we did not necessarily set `partitionRatio`
correctly, `forall` can terminate early.
* Add a couple of spotbugs exclusions that are needed by code generated by Scala 2.13
* Remove unused variables, simplify some code and remove procedure syntax in a few
places.
* Remove unused `CoreUtils.JSONEscapeString`.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, José Armando García Sancio <jsancio@users.noreply.github.com>
2019-07-02 06:29:39 -07:00
Dejan Stojadinović 5339d2dfd2 KAFKA-7197: Support Scala 2.13 (#5454)
- include Scala 2.13 in gradle build
- handle future milestone and RC versions of Scala in a better way
- if no Scala version is specified, default to scala 2.12 (bump from 2.11)
- include certain Xlint options (removed by Scala 2.13) for Scala 2.11/2.12 build only
- upgrade versions for dependencies: 
  - scalaLogging: 3.9.0 -->> 3.9.2
  - scalatest:        3.0.7 -->> 3.0.8
  - scoverage:       1.3.1 -->> 1.4.0

Reviewers: Ewen Cheslack-Postava <me@ewencp.org>, Ismael Juma <ismael@juma.me.uk>
2019-06-22 09:26:14 -07:00
Almog Gavra 8e161580b8 KAFKA-8305; Support default partitions & replication factor in AdminClient#createTopic (KIP-464) (#6728)
This commit makes three changes:
- Adds a constructor for NewTopic(String, Optional<Integer>, Optional<Short>)
which allows users to specify Optional.empty() for numPartitions or
replicationFactor in order to use the broker default.
- Changes AdminManager to accept -1 as valid options for replication
factor and numPartitions (resolving to broker defaults).
- Makes --partitions and --replication-factor optional arguments when creating
topics using kafka-topics.sh.
- Adds a dependency on scalaJava8Compat library to make it simpler to
convert Scala Option to Java Optional

Reviewers: Ismael Juma <ismael@juma.me.uk>, Ryanne Dolan <ryannedolan@gmail.com>, Jason Gustafson <jason@confluent.io>
2019-06-05 14:10:00 -07:00
Matthias J. Sax ba3dc49437
KAFKA-8155: Add 2.2.0 release to system tests (#6597)
Reviewers: Bill Bejeck <bill@confluent.io>, Boyang Chen <boyang@confluent.io>, Bruno Cadonna <bruno@confluent.io>, Guozhang Wang <guozhang@confuent.io>
2019-06-03 21:09:58 -07:00
tadsul 2c810e4afb KAFKA-8425: Fix for correctly handling immutable maps (KIP-421 bug) (#6795)
Since the originals map passed to AbstractConfig constructor may be immutable, avoid updating this map while resolving indirect config variables. Instead a new ResolvingMap instance is now used to store resolved configs.

Reviewers: Randall Hauch <rhauch@gmail.com>, Boyang Chen <bchen11@outlook.com>, Rajini Sivaram <rajinisivaram@googlemail.com>
2019-06-03 12:43:11 +01:00
Matthias J. Sax 55bfea1378
KAFKA-8155: Add 2.1.1 release to system tests (#6596)
Reviewers: Bill Bejeck <bill@confluent.io>, John Roesler <john@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2019-05-30 12:50:30 -07:00
José Armando García Sancio 121308cc7a KAFKA-8286; Generalized Leader Election Admin RPC (KIP-460) (#6686)
Implements KIP-460: https://cwiki.apache.org/confluence/display/KAFKA/KIP-460%3A+Admin+Leader+Election+RPC.

Reviewers: Jun Rao <junrao@gmail.com>, Jason Gustafson <jason@confluent.io>
2019-05-29 10:44:52 -07:00
Ismael Juma 6913290172
MINOR: Update jackson to 2.9.9 (#6798)
Important fix: https://github.com/FasterXML/jackson-databind/issues/2326

Reviewers: Colin P. McCabe <cmccabe@apache.org>
2019-05-23 17:00:33 -07:00
A. Sophie Blee-Goldman 16769d263e KAFKA-8215: Upgrade Rocks to v5.18.3 (#6743)
This upgrade exposes a number of new options, including the WriteBufferManager which -- along with existing TableConfig options -- allows users to limit the total memory used by RocksDB across instances. This can alleviate some cascading OOM potential when, for example, a large number of stateful tasks are suddenly migrated to the same host.

The RocksDB docs guarantee backwards format compatibility across versions

Reviewers: Matthias J. Sax <mjsax@apache.org>, Bill Bejeck <bbejeck@gmail.com>,
2019-05-17 16:32:17 -04:00
Ismael Juma 29b1f66c2c
MINOR: Update lz4-java to 1.6.0 for 12-18% decompression improvement (#6735)
lz4-java 1.6.0 relies on lz4 1.9.1, which includes significant
decompression performance improvements first released as part
of 1.9.0:

Version | v1.8.3 | v1.9.0 | Improvement
enwik8 | 4090 MB/s | 4560 MB/s | +12%
calgary.tar | 4320 MB/s | 4860 MB/s | +13%
silesia.tar | 4210 MB/s | 4970 MB/s | +18%

See https://github.com/lz4/lz4/releases/tag/v1.9.0 for more
details.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2019-05-14 23:23:22 -07: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
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
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
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
Alex Diachenko ec42e0378e KAFKA-7799; Use httpcomponents-client in RestServerTest.
The test `org.apache.kafka.connect.runtime.rest.RestServerTest#testCORSEnabled` assumes Jersey client can send restricted HTTP headers(`Origin`).

Jersey client uses `sun.net.www.protocol.http.HttpURLConnection`.
`sun.net.www.protocol.http.HttpURLConnection` drops restricted headers(`Host`, `Keep-Alive`, `Origin`, etc) based on static property `allowRestrictedHeaders`.
This property is initialized in a static block by reading Java system property `sun.net.http.allowRestrictedHeaders`.

So, if classloader loads `HttpURLConnection` before we set `sun.net.http.allowRestrictedHeaders=true`, then all subsequent changes of this system property won't take any effect(which happens if `org.apache.kafka.connect.integration.ExampleConnectIntegrationTest` is executed before `RestServerTest`).
To prevent this, we have to either make sure we set `sun.net.http.allowRestrictedHeaders=true` as early as possible or do not rely on this system property at all.

This PR adds test dependency on `httpcomponents-client` which doesn't depend on `sun.net.http.allowRestrictedHeaders` system property. Thus none of existing tests should interfere with `RestServerTest`.

Author: Alex Diachenko <sansanichfb@gmail.com>

Reviewers: Randall Hauch, Konstantine Karantasis, Gwen Shapira

Closes #6236 from avocader/KAFKA-7799
2019-02-12 12:03:08 -08:00
Ismael Juma c7f99bc2bd
MINOR: Update JUnit to 4.13 and annotate log cleaner integration test (#6248)
JUnit 4.13 fixes the issue where `Category` and `Parameterized` annotations
could not be used together. It also deprecates `ExpectedException` and
`assertThat`. Given this, we:

- Replace `ExpectedException` with the newly introduced `assertThrows`.
- Replace `Assert.assertThat` with `MatcherAssert.assertThat`.
- Annotate `AbstractLogCleanerIntegrationTest` with `IntegrationTest` category.

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>, David Arthur <mumrah@gmail.com>
2019-02-11 22:06:14 -08:00
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
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
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