Commit Graph

9747 Commits

Author SHA1 Message Date
Wenjun Ruan 760e6f3741
Add license header in suppressions.xml (#11753)
Add license header in suppressions.xml 

Reviewers: Luke Chen <showuon@gmail.com>
2022-02-17 14:35:36 +08:00
Chris Egerton c7586cc38d
KAFKA-13669; Demote empty offset commit messages for source tasks to DEBUG level (#11770)
Lower the log level of a message in `WorkerSourceTask` which indicates that no messages have been produced by the task since it is spammy and causing users confusion.

Reviewers: Jason Gustafson <jason@confluent.io>
2022-02-16 17:50:58 -08:00
Bruno Cadonna 333278d9bb
MINOR: Add actual state directory to related exceptions (#11751)
For debugging it is useful to see the actual state directory when
an exception regarding the state directory is thrown.

Reviewer: Bill Bejeck <bbejeck@apache.org>
2022-02-16 20:32:00 +01:00
Mickael Maison 8047ba3800
MINOR: Small cleanups in connect:runtime (#11756)
Reviewers: Jason Gustafson <jason@confluent.io>
2022-02-16 20:02:25 +01:00
Wenjun Ruan 81e709c4e2
MINOR: Remove unused params in `ZkConfigManager` (#11763)
Remove `changeExpirationMs` and `time` in `ZkConfigManager`, since these two parameters are not used.

Reviewers: Jason Gustafson <jason@confluent.io>
2022-02-16 10:12:07 -08:00
Matthias J. Sax c012fc411c
MINOR: improve JavaDocs for ReadOnlySessionStore (#11759)
Reviewer: Guozhang Wang <guozhang@confluent.io>
2022-02-16 08:40:47 -08:00
Michal T 6d7e6d6f87
MINOR: Install missing 'tc' utility - iproute2 for systemtests (#11764)
Signed-off-by: Michal T <mtoth@redhat.com>

Reviewers: Mickael Maison <mickael.maison@gmail.com>
2022-02-16 12:56:06 +01:00
keashem 1c7cd79792
MINOR: Fix sensor removal assertion in `MetricTest.testRemoveInactiveMetrics` (#11755)
The test case `MetricTest.testRemoveInactiveMetrics` attempts to test removal of inactive sensors, but one of the assertions is checking the wrong sensor name ("test.s1" instead of "test.s2"). The patch fixes the assertion to use the right sensor name.

Reviewers: Jason Gustafson <jason@confluent.io>

Co-authored-by: zhonghou3 <zhonghou3@jd.com>
2022-02-15 18:36:13 -08:00
Jason Gustafson b765a2b44e
MINOR: Remove redundant forwarding integration tests (#11766)
There are a few integration tests for the forwarding logic which were added prior to kraft being ready for integration testing. Now that we have enabled kraft in integration tests, these tests are redundant and can be removed.

Reviewers: José Armando García Sancio <jsancio@users.noreply.github.com>
2022-02-15 18:28:34 -08:00
Wenjun Ruan 77cb8e0a5a
MINOR: Remove repeat creation of `ZkConfigRepository` (#11762)
In `KafkaServer, `ZkConfigRepository` is just a wrapper of `zkClient`, so  we don't need to create a new one.

Reviewers: Jason Gustafson <jason@confluent.io>
2022-02-15 13:09:14 -08:00
A. Sophie Blee-Goldman fdb98df839
KAFKA-12648: avoid modifying state until NamedTopology has passed validation (#11750)
Previously we were only verifying the new query could be added after we had already inserted it into the TopologyMetadata, so we need to move the validation upfront.

Also adds a test case for this and improves handling of NPE in case of future or undiscovered bugs.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2022-02-15 13:06:54 -08:00
Luke Chen 71cbff62b6
MINOR: Fix and clarify kraft README and example configuration files (#11616)
Reviewers: Ron Dagostino <rdagostino@confluent.io>, Jason Gustafson <jason@confluent.io>
2022-02-15 10:27:38 -08:00
dengziming dd36331a81
MINOR: Enable kraft in ApiVersionTest (#11667)
This patch enables `ApiVersionsTest` to test both kraft brokers and controllers. It fixes a minor bug in which the `Envelope` request to be exposed from `ApiVersions` requests to the kraft broker. 

Reviewers: Jason Gustafson <jason@confluent.io>
2022-02-15 10:16:03 -08:00
Ismael Juma 71f732e6e5
MINOR: Clarify producer idempotence default in upgrade docs (#11757)
* Mention `acks=1` to `acks=all` change in 3.0.0 upgrade docs
* Have a separate section for 3.0.1 and 3.1.1 as some may skip the
  3.0.0/3.1.0 section when upgrading to a bug fix.
* Move the 3.0.0 note to the top since it's more impactful than the
  other changes.

Reviewers: Jason Gustafson <jason@confluent.io>
2022-02-14 15:17:44 -08:00
dengziming b5b590cb67
MINOR: Use bootstrap-server instead of broker-list in doc (#10832)
* MINOR: Use bootstrap-server instead of broker-list in doc

Reviewers: Luke Chen <showuon@gmail.com>
2022-02-14 20:24:20 +08:00
David Jacot c8fbe26f3b
KAFKA-13435; Static membership protocol should let the leader skip assignment (KIP-814) (#11688)
This patch implements KIP-814 as described here: https://cwiki.apache.org/confluence/display/KAFKA/KIP-814%3A+Static+membership+protocol+should+let+the+leader+skip+assignment.

Reviewers: Luke Chen <showuon@gmail.com>, Artem Livshits <alivshits@confluent.io>, Jason Gustafson <jason@confluent.io>
2022-02-14 11:55:38 +01:00
Mickael Maison f9201666a1
MINOR: Small cleanups in mirror/mirror-client (#11749)
Reviewers: Jason Gustafson <jason@confluent.io>
2022-02-14 10:17:54 +01:00
dengziming 076648e280
MINOR: MetadataShell should handle ProducerIdsRecord (#11603)
MetadataShell should be able to display contents from `ProducerIdsRecord`.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, David Arthur <mumrah@gmail.com>, Jason Gustafson <jason@confluent.io>
2022-02-12 11:11:21 -08:00
Jorge Esteban Quilcate Otoya 99310360a5
KAFKA-12939: After migrating processors, search the codebase for missed migrations (#11534)
Migrated internal usages that had previously been marked with TODO suppressions.

Reviewer: John Roesler<vvcephei@apache.org>
2022-02-11 22:25:03 -06:00
Jason Gustafson fc20c551d6
MINOR: Clearer field names for ProducerIdsRecord and related classes (#11747)
The current naming of the fields in `ProducerIdsRecord` is a little confusing in regard to whether the block range was inclusive or exclusive. This patch tries to improve naming to make this clearer. In the record class, instead of `ProducerIdsEnd`, we use `NextProducerId`. We have also updated related classes such as `ProducerIdsBlock.java` with similar changes.

Reviewers: dengziming <dengziming1993@gmail.com>, David Arthur <mumrah@gmail.com>
2022-02-11 16:14:31 -08:00
Jason Gustafson e43916c148
KAFKA-13661; Consistent permissions in KRaft for CreatePartitions API (#11745)
In #11649, we fixed one permission inconsistency between kraft and zk authorization for the `CreatePartitions` request. Previously kraft was requiring `CREATE` permission on the `Topic` resource when it should have required `ALTER`. A second inconsistency is that kraft was also allowing `CREATE` on the `Cluster` resource, which is not supported in zk clusters and was not documented in KIP-195: https://cwiki.apache.org/confluence/display/KAFKA/KIP-195%3A+AdminClient.createPartitions. This patch fixes this inconsistency and adds additional test coverage for both cases.

Reviewers: José Armando García Sancio <jsancio@gmail.com>
2022-02-11 15:01:08 -08:00
Matthias J. Sax 40b261f082
MINOR: improve logging (#11584)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Luke Chen <showuon@gmail.com>
2022-02-11 10:50:44 -08:00
Mickael Maison 0269edfc80
KAFKA-13577: Replace easymock with mockito in kafka:core - part 3 (#11674)
Reviewers: Tom Bentley <tbentley@redhat.com>
2022-02-11 16:16:25 +01:00
lhunyady 03af63d076
KAFKA-13306: Null connector config value passes validation, but fails creation (#11333)
This patch adds null value check to the connector config validation, and extends unit tests to cover this functionality.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chris Egerton <chrise@confluent.io>, Boyang Chen <bchen11@outlook.com>, Andras Katona <akatona@cloudera.com>
2022-02-11 16:14:06 +01:00
Vijay Krishna 368f4cee7a
KAFKA-13323; Fixed variable name in KafkaConsumer (#11558)
Fixes a misspelled variable name in `KafkaConsumer`: `cachedSubscriptionHashAllFetchPositions` -> `cachedSubscriptionHasAllFetchPositions`.

Reviewers: Kvicii <Karonazaba@gmail.com>, Jason Gustafson <jason@confluent.io>
2022-02-10 14:13:43 -08:00
dengziming 590df2c8be
KAFKA-13316; Enable KRaft mode in CreateTopics tests (#11655)
This PR follows #11629 to enable `CreateTopicsRequestWithForwardingTest` and `CreateTopicsRequestWithPolicyTest` in KRaft mode.

Reviewers: Jason Gustafson <jason@confluent.io>
2022-02-10 14:10:23 -08:00
Alexandre Garnier 4da515da94
MINOR: Fix storage meta properties comparison (#11546)
This patch adds missing `equals` and `hashCode` implements for `RawMetaProperties`. This is relied on by the storage tool for detecting when two log directories have different `meta.properties` files. 

Reproduce current issue:

```shell
$ sed -i 's|log.dirs=/tmp/kraft-combined-logs|+log.dirs=/tmp/kraft-combined-logs,/tmp/kraft-combined-logs2' ./config/kraft/server.properties

$ ./bin/kafka-storage.sh format -t R19xNyxMQvqQRGlkGDi2cg -c ./config/kraft/server.properties
Formatting /tmp/kraft-combined-logs
Formatting /tmp/kraft-combined-logs2

$ ./bin/kafka-storage.sh info -c ./config/kraft/server.properties
Found log directories:
  /tmp/kraft-combined-logs
  /tmp/kraft-combined-logs2

Found metadata: {cluster.id=R19xNyxMQvqQRGlkGDi2cg, node.id=1, version=1}

Found problem:
  Metadata for /tmp/kraft-combined-logs2/meta.properties was {cluster.id=R19xNyxMQvqQRGlkGDi2cg, node.id=1, version=1}, but other directories featured {cluster.id=R19xNyxMQvqQRGlkGDi2cg, node.id=1, version=1}
```

It's reporting that same metadata are not the same...

With this fix:

```shell
$ ./bin/kafka-storage.sh info -c ./config/kraft/server.properties
Found log directories:
  /tmp/kraft-combined-logs
  /tmp/kraft-combined-logs2

Found metadata: {cluster.id=R19xNyxMQvqQRGlkGDi2cg, node.id=1, version=1}
```

Reviewers: Igor Soarez <soarez@apple.com>, Jason Gustafson <jason@confluent.io>
2022-02-10 09:55:14 -08:00
prince-mahajan 78a3789496
KAFKA-13636: Fix for the group coordinator issue where the offsets are deleted for unstable groups (#11742)
This patch ensures that the committed offsets are not expired while the group is rebalancing. The issue is that we can't rely on the subscribed topics if the group is not stable.

Reviewers: David Jacot <djacot@confluent.io>
2022-02-10 17:21:17 +01:00
Joseph (Ting-Chou) Lin 2e25ca1355
MINOR: Fix JavaDoc of OffsetIndex#append (#11744)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2022-02-10 11:27:34 +01:00
Mickael Maison 57235a0cb4
KAFKA-13577: Replace easymock with mockito in kafka:core - part 2 (#11673)
Reviewers: Tom Bentley <tbentley@redhat.com>
2022-02-10 09:15:58 +01:00
Colin Patrick McCabe d35283f011
KAFKA-13646; Implement KIP-801: KRaft authorizer (#11649)
Currently, when using KRaft mode, users still have to have an Apache ZooKeeper instance if they want to use AclAuthorizer. We should have a built-in Authorizer for KRaft mode that does not depend on ZooKeeper. This PR introduces such an authorizer, called StandardAuthorizer. See KIP-801 for a full description of the new Authorizer design.

Authorizer.java: add aclCount API as described in KIP-801. StandardAuthorizer is currently the only authorizer that implements it, but eventually we may implement it for AclAuthorizer and others as well.

ControllerApis.scala: fix a bug where createPartitions was authorized using CREATE on the topic resource rather than ALTER on the topic resource as it should have been.

QuorumTestHarness: rename the controller endpoint to CONTROLLER for consistency (the brokers already called it that). This is relevant in AuthorizerIntegrationTest where we are examining endpoint names. Also add the controllerServers call.

TestUtils.scala: adapt the ACL functions to be usable from KRaft, by ensuring that they use the Authorizer from the current active controller.

BrokerMetadataPublisher.scala: add broker-side ACL application logic.

Controller.java: add ACL APIs. Also add a findAllTopicIds API in order to make junit tests that use KafkaServerTestHarness#getTopicNames and KafkaServerTestHarness#getTopicIds work smoothly.

AuthorizerIntegrationTest.scala: convert over testAuthorizationWithTopicExisting (more to come soon)

QuorumController.java: add logic for replaying ACL-based records. This means storing them in the new AclControlManager object, and integrating them into controller snapshots. It also means applying the changes in the Authorizer, if one is configured. In renounce, when reverting to a snapshot, also set newBytesSinceLastSnapshot to 0.

Reviewers: YeonCheol Jang <YeonCheolGit@users.noreply.github.com>,  Jason Gustafson <jason@confluent.io>
2022-02-09 10:38:52 -08:00
Mickael Maison 150fecf6d3
KAFKA-13577: Replace easymock with mockito in kafka:core - part 1 (#11672)
Reviewers: Tom Bentley <tbentley@redhat.com>
2022-02-09 17:02:27 +01:00
RivenSun 4b468a9d81
KAFKA-13310 : KafkaConsumer cannot jump out of the poll method, and the… (#11340)
Title: KafkaConsumer cannot jump out of the poll method, and cpu and traffic on the broker side increase sharply
description: The local test has been passed, the problem described by jira can be solved

JIRA link : https://issues.apache.org/jira/browse/KAFKA-13310

Reviewers: Luke Chen <showuon@gmail.com>, Guozhang Wang <wangguoz@gmail.com>
2022-02-08 23:05:42 -08:00
Ismael Juma 61b0014ec9
MINOR: Move `ext` block above `allprojects` block in `build.gradle` (#11741)
`ext` contains definitions that should be accessible in `allprojects`
(even though we don't use any right now).

Reviewers: Jason Gustafson <jason@confluent.io>
2022-02-08 12:43:45 -08:00
Ismael Juma ca375d8004
MINOR: Reduce scala compilation time by 15% via scalac backend parallelism (#11739)
Introduce `maxScalacThreads` and set the default to the lowest of `8`
and the number of processors available to the JVM. The number `8` was
picked empirically, the sweet spot is between 6 and 10.

On my desktop, `./gradlew clean core:compileScala core:compileTestScala`
improved from around 60s to 51s ( with this change.

While at it, we improve the build output to include more useful
information at the start: build id, max parallel forks, max scala
threads and max test retries.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Sean Li
2022-02-08 11:03:19 -08:00
Michal T 44fcba980f
MINOR: Fix typo in system tests Dockerfile (#11740)
Reviewers: Mickael Maison <mickael.maison@gmail.com>
2022-02-08 18:03:57 +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
Wenhao Ji f1fdd31e8f
KAFKA-7572: Producer should not send requests with negative partition id (#10525)
This PR is for KAFKA-7572, which fixes the issue that producers will throw confusing exceptions when a custom Partitioner returns a negative partition. Since the PR #5858 is not followed by anyone currently, I reopen this one to continue the work.

Reviewers: Luke Chen <showuon@gmail.com>, Guozhang Wang <wangguoz@gmail.com>
2022-02-07 09:53:10 -08:00
Ismael Juma b125a06c46
MINOR: Use CRC32 from standard library and remove custom implementation (#11736)
We only use it in the legacy record formats (V0 and V1) and the CRC32
implementation in the standard library has received various performance
improvements over the years
(https://bugs.openjdk.java.net/browse/JDK-8245512 is a recent example).

Also worth noting that record formats V0 and V1 have been deprecated
since Apache Kafka 3.0.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Kvicii <Karonazaba@gmail.com>
2022-02-07 06:42:30 -08:00
Luke Chen ca5d6f9229
KAFKA-13563: clear FindCoordinatorFuture for non consumer group mode (#11631)
After KAFKA-10793, we clear the findCoordinatorFuture in 2 places:

1. heartbeat thread
2. AbstractCoordinator#ensureCoordinatorReady

But in non consumer group mode with group id provided (for offset commitment. So that there will be consumerCoordinator created), there will be no (1)heartbeat thread , and it only call (2)AbstractCoordinator#ensureCoordinatorReady when 1st time consumer wants to fetch committed offset position. That is, after 2nd lookupCoordinator call, we have no chance to clear the findCoordinatorFuture , and causes the offset commit never succeeded.

To avoid the race condition as KAFKA-10793 mentioned, it's not safe to clear the findCoordinatorFuture in the future listener. So, I think we can fix this issue by calling AbstractCoordinator#ensureCoordinatorReady when coordinator unknown in non consumer group case, under each ConsumerCoordinator#poll.


Reviewers: Guozhang Wang <wangguoz@gmail.com>
2022-02-06 15:07:59 -08:00
Jason Koch c05403f47f
KAFKA-13629: Use faster algorithm for ByteUtils sizeOfXxx algorithm (#11721)
Replace loop with a branch-free implementation.

Include:
- Unit tests that includes old code and new code and runs through several ints/longs.
- JMH benchmark that compares old vs new performance of algorithm.

JMH results with JDK 17.0.2 and `compiler` blackhole mode are 2.8-3.4 faster with
the new implementation. In a real application, a 6% reduction in CPU cycles was
observed in the `send()` path via flamegraphs.

```
ByteUtilsBenchmark.testSizeOfUnsignedVarint                            thrpt    4  1472440.102 ±  67331.797  ops/ms
ByteUtilsBenchmark.testSizeOfUnsignedVarint:·async                     thrpt               NaN                  ---
ByteUtilsBenchmark.testSizeOfUnsignedVarint:·gc.alloc.rate             thrpt    4       ≈ 10⁻⁴               MB/sec
ByteUtilsBenchmark.testSizeOfUnsignedVarint:·gc.alloc.rate.norm        thrpt    4       ≈ 10⁻⁷                 B/op
ByteUtilsBenchmark.testSizeOfUnsignedVarint:·gc.count                  thrpt    4          ≈ 0               counts
ByteUtilsBenchmark.testSizeOfUnsignedVarintSimple                      thrpt    4   521333.117 ± 595169.618  ops/ms
ByteUtilsBenchmark.testSizeOfUnsignedVarintSimple:·async               thrpt               NaN                  ---
ByteUtilsBenchmark.testSizeOfUnsignedVarintSimple:·gc.alloc.rate       thrpt    4       ≈ 10⁻⁴               MB/sec
ByteUtilsBenchmark.testSizeOfUnsignedVarintSimple:·gc.alloc.rate.norm  thrpt    4       ≈ 10⁻⁶                 B/op
ByteUtilsBenchmark.testSizeOfUnsignedVarintSimple:·gc.count            thrpt    4          ≈ 0               counts
ByteUtilsBenchmark.testSizeOfVarlong                                   thrpt    4  1106519.633 ±  16556.502  ops/ms
ByteUtilsBenchmark.testSizeOfVarlong:·async                            thrpt               NaN                  ---
ByteUtilsBenchmark.testSizeOfVarlong:·gc.alloc.rate                    thrpt    4       ≈ 10⁻⁴               MB/sec
ByteUtilsBenchmark.testSizeOfVarlong:·gc.alloc.rate.norm               thrpt    4       ≈ 10⁻⁶                 B/op
ByteUtilsBenchmark.testSizeOfVarlong:·gc.count                         thrpt    4          ≈ 0               counts
ByteUtilsBenchmark.testSizeOfVarlongSimple                             thrpt    4   324435.607 ± 147754.813  ops/ms
ByteUtilsBenchmark.testSizeOfVarlongSimple:·async                      thrpt               NaN                  ---
ByteUtilsBenchmark.testSizeOfVarlongSimple:·gc.alloc.rate              thrpt    4       ≈ 10⁻⁴               MB/sec
ByteUtilsBenchmark.testSizeOfVarlongSimple:·gc.alloc.rate.norm         thrpt    4       ≈ 10⁻⁶                 B/op
ByteUtilsBenchmark.testSizeOfVarlongSimple:·gc.count                   thrpt    4          ≈ 0               counts
```

Reviewers: Ismael Juma <ismael@juma.me.uk>, Artem Livshits
2022-02-06 13:36:44 -08:00
Chia-Ping Tsai f49524e4c3
MINOR: disable zookeeper.sasl.client to avoid false error (#11469)
Reviewers: Mickael Maison <mimaison@users.noreply.github.com>
2022-02-06 03:34:22 +08:00
Jason Gustafson ba0fe610ed
MINOR: Do not use optional args in `ProducerStateManager` (#11734)
We allowed `maxProducerIdExpirationMs` and `time` to be optional in the `ProducerStateManager` constructor. We generally frown on optional arguments since it is too easy to overlook them. In this case, it was especially dangerous because the recently added `maxTransactionTimeoutMs` argument used the same type as `maxProducerIdExpirationMs`.

Reviewers: David Jacot <david.jacot@gmail.com, Ismael Juma <ismael@juma.me.uk>
2022-02-05 11:00:17 -08:00
Luke Chen e6db0ca48c
KAFKA-13598: enable idempotence producer by default and validate the configs (#11691)
In v3.0, we changed the default value for `enable.idempotence` to true, but we didn't adjust the validator and the `idempotence` enabled check method. So if a user didn't explicitly enable idempotence, this feature won't be turned on. This patch addresses the problem, cleans up associated logic, and fixes tests that broke as a result of properly applying the new default. Specifically it does the following:

1. fix the `ProducerConfig#idempotenceEnabled` method, to make it correctly detect if `idempotence` is enabled or not
2. remove some unnecessary config overridden and checks due to we already default `acks`, `retries` and `enable.idempotence` configs.
3. move the config validator for the idempotent producer from `KafkaProducer` into `ProducerConfig`. The config validation should be the responsibility of `ProducerConfig` class.
4. add an `AbstractConfig#hasKeyInOriginals` method, to avoid `originals` configs get copied and only want to check the existence of the key. 
5. fix many broken tests. As mentioned, we didn't actually enable idempotence in v3.0. After this PR, there are some tests broken due to some different behavior between idempotent and non-idempotent producer.
6. add additional tests to validate configuration behavior

Reviewers: Kirk True <kirk@mustardgrain.com>, Ismael Juma <ismael@juma.me.uk>, Mickael Maison <mimaison@users.noreply.github.com>, Jason Gustafson <jason@confluent.io>
2022-02-05 10:53:27 -08:00
Matthew Wong 17dcb8097c
MINOR: Update documentation and DumpLogSegments tool for addition of `deleteHorizonMs` in batch format (#11694)
This PR updates the documentation and tooling to match https://github.com/apache/kafka/pull/10914, which added support for encoding `deleteHorizonMs` in the record batch schema. The changes include adding the new attribute and updating field names. We have also updated stale references to the old `FirstTimestamp` field in the code and comments. Finally, In the `DumpLogSegments` tool, when record batch information is printed, it will also include the value of `deleteHorizonMs` is (e.g. `OptionalLong.empty` or `OptionalLong[123456]`).

Reviewers: Vincent Jiang <84371940+vincent81jiang@users.noreply.github.com>, Kvicii <42023367+Kvicii@users.noreply.github.com>, Jason Gustafson <jason@confluent.io>
2022-02-04 16:20:37 -08:00
Colin Patrick McCabe d4fb388583
MINOR: fix control plane listener + kraft error message (#11729)
The current error message suggests that controller.listener.names is a replacement for
control.plane.listener.name. This is incorrect since these configurations have very different
functions. This PR deletes the incorrect message.

Reviewers: David Jacot <david.jacot@gmail.com>, Kvicii
2022-02-03 10:08:00 -08:00
Kvicii 21c3009ac1
KAFKA-13583; Fix FetchRequestBetweenDifferentIbpTest flaky tests (#11699)
Co-authored-by: Kvicii <Karonazaba@gmail.com>
Reviewers: David Jacot <djacot@confluent.io>
2022-02-03 10:59:12 +01:00
Lucas Bradstreet 3781117653
MINOR: MiniTrogdorCluster mutates objects from other threads (#11710)
MiniTrogdorCluster spins up agents from a different thread when scheduling them, but does not use volatiles in these objects. It's not clear that the updated fields are visible.

Reviewers: Colin P. McCabe <cmccabe@apache.org>, Kvicii <Karonazaba@gmail.com>, David Jacot <djacot@confluent.io>
2022-02-03 10:57:21 +01:00
Kvicii 23771cd27c
MINOR: Fix AbstractStickyAssignor doc (#11727)
Reviewers: David Jacot <djacot@confluent.io>
2022-02-03 10:54:54 +01:00
dengziming af6a9a17bf
KAFKA-13637: Use default.api.timeout.ms as default timeout value for KafkaConsumer.endOffsets (#11726)
We introduced `default.api.timeout.ms` in 53ca52f855 but we missed updating `KafkaConsumer.endOffsets` which still use `request.timeout.ms`. This patch fixes this.

Reviewers: David Jacot <djacot@confluent.io>
2022-02-03 10:32:25 +01:00