Commit Graph

9757 Commits

Author SHA1 Message Date
Walker Carlson d8cf47bf28
KAFKA-13676: Commit successfully processed tasks on error (#11791)
When we hit an exception when processing tasks we should save the work we have done so far.
This will only be relevant with ALOS and EOS-v1, not EOS-v2. It will actually reduce the number of duplicated record in ALOS because we will not be successfully processing tasks successfully more than once in many cases.

This is currently enabled only for named topologies.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Guozhang Wang <guozhang@confluent.io>
2022-02-22 23:10:05 -08:00
Julien Chanaud a5bb45c11a
KAFKA-13511: Add support for different unix precisions in TimestampConverter SMT (#11575)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Tom Bentley <tbentley@redhat.com>
2022-02-22 17:17:16 +01:00
Mickael Maison 576496a1ca
MINOR: Improve Connect docs (#11642)
- Fix indendation of code blocks
- Add links to all SMTs and Predicates

Reviewers: Luke Chen <showuon@gmail.com>, Tom Bentley <tbentley@redhat.com>
2022-02-22 20:49:53 +08:00
Mickael Maison 2dc4d5d95e
MINOR: Add links to connector configs in TOC (#11794)
Reviewers: Luke Chen <showuon@gmail.com>, Andrew Eugene Choi <andrew.choi@uwaterloo.ca>
2022-02-22 10:54:53 +08:00
Chris Egerton 4d036ee871
MINOR: Clarify logging behavior with errors.log.include.messages property (#11758)
The docs are a little misleading and some users can be confused about the exact behavior of this property.
2022-02-21 07:55:04 -06:00
Kamal Chandraprakash 496aa1f84b
MINOR: Provide valid examples in README page. (#10259)
* MINOR: Provide valid examples in README page.

- `testMetadataUpdateWaitTime` method is removed from MetadataTest class.
-  Removed the travis CI documentation.

Reviewers: Luke Chen <showuon@gmail.com>
2022-02-21 14:48:24 +08:00
Rob Leland 06ca4850c5
KAFKA-13666 Don't Only ignore test exceptions for windows OS for certain tests. (#11752)
Tests are swallowing exceptions for supported operating systems, which could hide regressions.

Co-authored-by: Rob Leland <rleland@apache.org>

Reviewer: Bruno Cadonna <cadonna@apache.org>
2022-02-18 14:49:03 +01:00
A. Sophie Blee-Goldman 4c23e47bd5
MINOR: move non-management methods from TaskManager to Task Executor (#11738)
Basic refactoring with no logical changes to lay the groundwork & facilitate reviews for error handling work.

This PR just moves all methods that go beyond the management of tasks into a new TaskExecutor class, such as processing, committing, and punctuating. This breaks up the ever-growing TaskManager class so it can focus on the tracking and updating of the tasks themselves, while the TaskExecutor can focus on the actual processing. In addition to cleaning up this code this should make it easier to test this part of the code.

Reviewers: Guozhang Wang <guozhang@confluent.io>, Walker Carlson <wcarlson@confluent.io>
2022-02-18 00:39:41 -08:00
dengziming a4b1e50f08
MINOR; Remove unused AdminZkClient in MetadataSupport (#11785)
Remove unused AdminZkClient in MetadataSupport

Reviewers: Luke Chen <showuon@gmail.com>
2022-02-18 14:31:44 +08:00
RivenSun 219a446feb
MINOR: Optimize the matches method of AccessControlEntryFilter (#11768)
* MINOR: Make the getters in match method in AccessControlEntryFilter consistency

Reviewers: Luke Chen <showuon@gmail.com>
2022-02-17 20:56:57 +08:00
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