Commit Graph

10511 Commits

Author SHA1 Message Date
Alan Sheinberg 481fefb4f9
MINOR: Adds KRaft versions of most streams system tests (#12458)
Migrates Streams sustem tests to either use kraft brokers or to use both kraft and zk in a testing matrix.

This skips tests which use various forms of Kafka versioning since those seem to have issues with KRaft at the moment. Running these tests with KRaft will require a followup PR.

Reviewers: Guozhang Wang <guozhang@apache.org>, John Roesler <vvcephei@apache.org>
2022-08-26 16:11:19 -05:00
Colin Patrick McCabe f0f918b242
KAFKA-14177: Correctly support older kraft versions without FeatureLevelRecord (#12513)
The main changes here are ensuring that we always have a metadata.version record in the log, making
˘sure that the bootstrap file can be used for records other than the metadata.version record (for
example, we will want to put SCRAM initialization records there), and fixing some bugs.

If no feature level record is in the log and the IBP is less than 3.3IV0, then we assume the minimum KRaft
version for all records in the log.

Fix some issues related to initializing new clusters. If there are no records in the log at all,
then insert the bootstrap records in a single batch. If there are records, but no metadata version,
process the existing records as though they were metadata.version 3.3IV0 and then append a metadata
version record setting version 3.3IV0.  Previously, we were not clearly distinguishing between the
case where the metadata log was empty, and the case where we just needed to add a metadata.version
record.

Refactor BootstrapMetadata into an immutable class which contains a 3-tuple of metadata version,
record list, and source. The source field is used to log where the bootstrap metadata was obtained
from. This could be a bootstrap file, the static configuration, or just the software defaults.
Move the logic for reading and writing bootstrap files into BootstrapDirectory.java.

Add LogReplayTracker, which tracks whether the log is empty.

Fix a bug in FeatureControlManager where it was possible to use a "downgrade" operation to
transition to a newer version. Do not store whether we have seen a metadata version or not in
FeatureControlManager, since that is now handled by LogReplayTracker.

Introduce BatchFileReader, which is a simple way of reading a file containing batches of snapshots
that does not require spawning a thread. Rename SnapshotFileWriter to BatchFileWriter to be
consistent, and to reflect the fact that bootstrap files aren't snapshots.

QuorumController#processBrokerHeartbeat: add an explanatory comment.

Reviewers: David Arthur <mumrah@gmail.com>, Jason Gustafson <jason@confluent.io>
2022-08-25 18:12:31 -07:00
José Armando García Sancio 4a870c0335
MINOR; Update upgrade documentation for 3.3 (#12550) 2022-08-25 17:27:14 -07:00
Jason Gustafson 289ab1494d
MINOR: Dump log tool should support bootstrap checkpoint (#12556)
This patch adds support to `kafka-dump-log.sh` to print the `bootstrap.checkpoint` file from KIP-778: https://cwiki.apache.org/confluence/display/KAFKA/KIP-778:+KRaft+Upgrades.

Reviewers:  dengziming <dengziming1993@gmail.com>, Luke Chen <showuon@gmail.com>
2022-08-25 09:17:55 -07:00
Guozhang Wang 63e6fdc9c4
MINOR: Improve javadocs for offset retention (#12552)
Our docs for offset retention has been outdated and hence needs to be updated. Also I think it's better to indicate how we handle offsets when delete-topics and delete-groups.

Reviewers: Victoria Xia <victoria.f.xia281@gmail.com>, Luke Chen <showuon@gmail.com>
2022-08-25 09:11:38 -07:00
Mickael Maison 8d665c42e2
MINOR: Small cleanups in integration.kafka tests (#12480)
Reviewers: Luke Chen <showuon@gmail.com>, Divij Vaidya <diviv@amazon.com>, Christo Lolov <christo_lolov@yahoo.com>
2022-08-25 09:55:43 +02:00
dengziming 19581effbf
KAFKA-13850: Show missing record type in MetadataShell (#12103)
AccessControlEntryRecord and RemoveAccessControlEntryRecord are added in KIP-801, FeatureLevelRecord was added in KIP-778, and BrokerRegistrationChangeRecord was added in KIP-841, and NoOpRecord was added in KIP-835, I added these 5 record types in MetadataShell.

 Reviewers: Luke Chen <showuon@gmail.com>
2022-08-25 14:09:01 +08:00
Liam Clarke-Hutchinson b988528b91
MINOR: re-enable WorkerTest for java 16+ (#12557)
Re-enable WorkerTest for java 16+ since we've removed powerMock in the test

Reviewers: Luke Chen <showuon@gmail.com>
2022-08-25 13:54:55 +08:00
Jason Gustafson 5c52c61a46
MINOR: A few cleanups for DescribeQuorum APIs (#12548)
A few small cleanups in the `DescribeQuorum` API and handling logic:

- Change field types in `QuorumInfo`:
  - `leaderId`: `Integer` -> `int`
  - `leaderEpoch`: `Integer` -> `long` (to allow for type expansion in the future)
  - `highWatermark`: `Long` -> `long`
- Use field names `lastFetchTimestamp` and `lastCaughtUpTimestamp` consistently
- Move construction of `DescribeQuorumResponseData.PartitionData` into `LeaderState`
- Consolidate fetch time/offset update logic into `LeaderState.ReplicaState.updateFollowerState`

Reviewers: Luke Chen <showuon@gmail.com>, José Armando García Sancio <jsancio@users.noreply.github.com>
2022-08-24 13:12:14 -07:00
Mickael Maison 0507597597
KAFKA-10360: Allow disabling JMX Reporter (KIP-830) (#12046)
This implements KIP-830: https://cwiki.apache.org/confluence/display/KAFKA/KIP-830%3A+Allow+disabling+JMX+Reporter
It adds a new configuration `auto.include.jmx.reporter` that can be set to false to disable the JMX Reporter. This configuration is deprecated and will be removed in the next major version.

Reviewers: Tom Bentley <tbentley@redhat.com>, Christo Lolov <christo_lolov@yahoo.com>
2022-08-24 18:30:31 +02:00
Bill Bejeck 008d1afc4d
MINOR: Update site docs for ASF compliance (#12494)
This PR is a mirror of apache/kafka-site#433 which used placeholder images for the Kafka Streams that users need to click in order to load the iframe with the corresponding video.

Reviewers: Mickael Maison <mimaison@apache.org>
2022-08-24 10:45:32 -04:00
David Arthur 5eff8592cc
KAFKA-14178 Don't record queue time for deferred events (#12551) 2022-08-24 10:01:48 -04:00
Matthew de Detrich 4170e74295
MINOR: Use underscore for variable initialization in Scala sources (#12534)
In Scala it's standard practice to use `_` whenever you are initializing variables. In regard to implementation, for object references, `_` initialization maps to `null` so there is no change in behavior.

Reviewers: Mickael Maison <mickael.maison@gmail.com>
2022-08-24 15:07:13 +02:00
Bruno Cadonna f191126550
KAFKA-10199: Introduce task registry (#12549)
Currently the task manager stores the tasks it manages in an
internally. We recently extracted the code to store and retrieve
tasks into its own class Tasks. However, the task manager creates
the Tasks object internally and during testing of the task
manager we do not have access to it which makes testing the task
manager quite complex.

This commit externalizes the data structure that the task manager
uses to store and rerieve tasks. It introduces the TasksRegistry
interface and lets the Tasks object implementing TasksRegistry.
The Tasks object is passed into the task manager via its
constructor. Passing the TasksRegistry dependency to the task
manager from outside faciliates simpler testing of the task
manager.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Walker Carlson <wcarlson@confluent.io>
2022-08-24 08:19:40 +02:00
Divij Vaidya 4b310d1fe1
KAFKA-13133: Replace EasyMock and PowerMock with Mockito for AbstractHerderTest (#12473)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Yash Mayya <yash.mayya@gmail.com>

Co-authored-by: wycccccc <493172422@qq.com>
Co-authored-by: wycccccc <43372856+wycccccc@users.noreply.github.com>
2022-08-23 17:49:38 +02:00
Mickael Maison 4bd3fd840d
KAFKA-14160: Streamline clusterId retrieval in Connect (#12536)
Cache the Kafka cluster Id once it has been retrieved to avoid creating many Admin clients at startup.

Reviewers: Chris Egerton <fearthecellos@gmail.com>
2022-08-23 17:09:22 +02:00
Yash Mayya 6df57679d0
KAFKA-14162: Stop adding immutable maps/lists to record keys/values in HoistField and MaskField SMTs (#12502)
Reviewers:  Sagar Rao <sagarmeansocean@gmail.com>, Chris Egerton <fearthecellos@gmail.com>
2022-08-23 10:22:02 -04:00
Divij Vaidya 9aef992118
MINOR: Catch InvocationTargetException explicitly and propagate underlying cause (#12230)
Catch InvocationTargetException explicitly and propagate underlying cause

Reviewers: Ismael Juma <mlists@juma.me.uk>, Matthew de Detrich <mdedetrich@gmail.com>, Kvicii, Luke Chen <showuon@gmail.com>
2022-08-23 17:34:39 +08:00
Bruno Cadonna add4ca6c7f
KAFKA-10199: Remove tasks from state updater on revoked and lost partitions (#12547)
Removes tasks from the state updater when the input partitions of the tasks are revoked or partitions are lost during a rebalance.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2022-08-22 11:50:50 -07:00
Yash Mayya ddb7fdd88f
KAFKA-14133: Replace EasyMock with Mockito in WorkerCoordinatorTest and RootResourceTest (#12509)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Dalibor Plavcic <dalibor.os@proton.me>
2022-08-22 20:17:34 +02:00
Yash Mayya 519d8ac5b9
KAFKA-14147: Prevent deferredTaskUpdates map from growing monotonically in KafkaConfigBackingStore (#12490)
Reviewers: Chris Egerton <fearthecellos@gmail.com>
2022-08-22 10:13:43 -04:00
Justine Olshan b392cf212f
KAFKA-14097: Separate configuration for producer ID expiry (KIP-854) (#12501)
This patch implements "KIP-854: Separate configuration for producer ID expiry" as described here: https://cwiki.apache.org/confluence/display/KAFKA/KIP-854+Separate+configuration+for+producer+ID+expiry.

Reviewers: David Jacot <djacot@confluent.io>
2022-08-22 10:56:05 +02:00
dengziming 150fd5b0b1
KAFKA-13914: Add command line tool kafka-metadata-quorum.sh (#12469)
Add `MetadataQuorumCommand` to describe quorum status, I'm trying to use arg4j style command format, currently, we only support one sub-command which is "describe" and we can specify 2 arguments which are --status and --replication.

```
# describe quorum status
kafka-metadata-quorum.sh --bootstrap-server localhost:9092 describe --replication

ReplicaId	LogEndOffset	Lag	LastFetchTimeMs	LastCaughtUpTimeMs	Status  	
0        	10          	        0  	-1             	        -1                	                 Leader  	
1        	10          	        0  	-1             	        -1                	                 Follower	
2        	10          	        0  	-1             	        -1                	                 Follower	

kafka-metadata-quorum.sh --bootstrap-server localhost:9092 describe --status
ClusterId:                             fMCL8kv1SWm87L_Md-I2hg
LeaderId:                             3002
LeaderEpoch:                      2
HighWatermark:                  10
MaxFollowerLag:                 0
MaxFollowerLagTimeMs:   -1
CurrentVoters:                    [3000,3001,3002]
CurrentObservers:              [0,1,2]

# specify AdminClient properties
kafka-metadata-quorum.sh --bootstrap-server localhost:9092 --command-config config.properties describe --status
```

Reviewers: Jason Gustafson <jason@confluent.io>
2022-08-20 08:37:26 -07:00
Niket c7f051914e
KAFKA-13888; Implement `LastFetchTimestamp` and in `LastCaughtUpTimestamp` for DescribeQuorumResponse [KIP-836] (#12508)
This commit implements the newly added fields `LastFetchTimestamp` and `LastCaughtUpTimestamp` for KIP-836: https://cwiki.apache.org/confluence/display/KAFKA/KIP-836:+Addition+of+Information+in+DescribeQuorumResponse+about+Voter+Lag.

Reviewers: Jason Gustafson <jason@confluent.io>
2022-08-19 15:09:09 -07:00
Jason Gustafson a724166fcc
MINOR: Fix unexpected request error in kraft shutdown (#12538)
We have been seeing a few exceptions like the following when running integration tests:
```
[2022-08-18 13:02:59,470] ERROR [ControllerApis nodeId=3000] Unexpected error handling request RequestHeader(apiKey=FETCH, apiVersion=13, clientId=raft-client-0, correlationId=7) -- FetchRequestData(clusterId='txpo87ZUSbGSeV2v7H0n_w', replicaId=0, maxWaitMs=500, minBytes=0, maxBytes=8388608, isolationLevel=0, sessionId=0, sessionEpoch=-1, topics=[FetchTopic(topic='__cluster_metadata', topicId=AAAAAAAAAAAAAAAAAAAAAQ, partitions=[FetchPartition(partition=0, currentLeaderEpoch=1, fetchOffset=6, lastFetchedEpoch=1, logStartOffset=-1, partitionMaxBytes=0)])], forgottenTopicsData=[], rackId='') with context RequestContext(header=RequestHeader(apiKey=FETCH, apiVersion=13, clientId=raft-client-0, correlationId=7), connectionId='127.0.0.1:63113-127.0.0.1:63114-0', clientAddress=/127.0.0.1, principal=User:ANONYMOUS, listenerName=ListenerName(CONTROLLER), securityProtocol=PLAINTEXT, clientInformation=ClientInformation(softwareName=apache-kafka-java, softwareVersion=unknown), fromPrivilegedListener=false, principalSerde=Optional[org.apache.kafka.common.security.authenticator.DefaultKafkaPrincipalBuilder@201038c3]) (kafka.server.ControllerApis:76)
java.util.concurrent.CompletionException: java.util.NoSuchElementException: key not found: BROKER_NOT_AVAILABLE
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:936)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
	at org.apache.kafka.raft.KafkaRaftClient.lambda$handleRequest$19(KafkaRaftClient.java:1666)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
	at kafka.raft.TimingWheelExpirationService$TimerTaskCompletableFuture.run(TimingWheelExpirationService.scala:32)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.util.NoSuchElementException: key not found: BROKER_NOT_AVAILABLE
```
There are two causes for this error that I found. First, we were not shutting down the timer services in `RaftManager` which are used in the purgatory implementation. This meant that operations remaining in purgatory could be completed even after `RaftManager` was shutdown. Second, the shutdown order in `KafkaClusterTestKit` was problematic. The `RaftManager` instance depends on the `SocketServer` in `ControllerServer`, but it was the latter that was shutdown first. Instead, we should shutdown `RaftManager` first as we do in `KafkaRaftServer`. 

Reviewers: Ismael Juma <ismael@juma.me.uk>
2022-08-19 12:45:05 -07:00
Guozhang Wang 5d32f24cc3
MINOR: Improve KafkaProducer Javadocs (#12537)
While reviewing KIP-588 and KIP-691 I went through the exception throwing behavior and wanted to improve the related javadocs a little bit.

Reviewers: John Roesler <vvcephei@apache.org>
2022-08-19 10:09:48 -07:00
Igor Soarez 28435d74f0
MINOR: Avoid possibly resolvable name in tests (#12198)
Reviewers: Divij Vaidya <diviv@amazon.com>, David Jacot <djacot@confluent.io>
2022-08-19 14:09:20 +02:00
Luke Chen bc50f70219
remove sleep in test (#12525)
Remove spurious sleep in ConsumerCoordinatorTest

Reviewers: Ismael Juma <mlists@juma.me.uk>
2022-08-19 14:17:33 +08:00
Akhilesh C 5f4af5f7d1
KAFKA-14170: Fix NPE in the deleteTopics() code path of KRaft Controller (#12533)
Fix a bug in ReplicationControlManager where we got a NullPointerException when removing a topic
with no offline replicas, and there were other topics that did have offline replicas.

Fix an issue in MetadataDelta#replay where we were replaying RemoveTopicRecord twice.

Reviewers: Colin P. McCabe <cmccabe@apache.org>, dengziming <dengziming1993@gmail.com>
2022-08-18 17:14:17 -07:00
Alex Sorokoumov 5c77c544c6
KAFKA-13769 Fix version check in SubscriptionStoreReceiveProcessorSupplier (#12535)
This patch fixes another incorrect version check in the FK code and adds unit tests that would have caught this bug.

Reviewers: John Roesler <vvcephei@apache.org>
2022-08-18 13:20:04 -05:00
Matthew de Detrich 2ff4c0a364
MINOR: Use underscore for variable initialization in BrokerServer (#12471)
In Scala its standard practice to use _ whenever you are initializing variables. In regards to implementation, for object references _ initialization maps to null so there is no change in behaviour.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Divij Vaidya <diviv@amazon.com>
2022-08-18 12:26:33 +02:00
Chris Egerton 73e8d5dd5b
MINOR: Remove unused ShutdownableThread class and ineffective ThreadedTest class (#12410)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Christo Lolov <christo_lolov@yahoo.com>
2022-08-18 12:08:03 +02:00
David Jacot 04fce135d3
MINOR: Log error when storing assignment fails (#12526)
Reviewers: Jason Gustafson <jason@confluent.io>
2022-08-18 09:37:20 +02:00
Jason Gustafson bc90c29faf
KAFKA-14167; Completion exceptions should not be translated directly to error codes (#12518)
There are a few cases in `ControllerApis` where we may see an `ApiException` wrapped as a `CompletionException`. This can happen in `QuorumController.allocateProducerIds` where the returned future is the result of calling `thenApply` on the future passed to the controller. The danger when this happens is that the `CompletionException` gets passed to `Errors.forException`, which translates it to an `UNKNOWN_SERVER_ERROR`. At a minimum, I found that the `AllocateProducerIds` and `UpdateFeatures` APIs were affected by this bug, but it is difficult to root out all cases. 

Interestingly, `DeleteTopics` is not affected by this bug as I originally suspected. This is because we have logic in `ApiError.fromThrowable` to check for both `CompletionException` and `ExecutionException` and to pull out the underlying cause. This patch duplicates this logic from `ApiError.fromThrowable` into `Errors.forException` to be sure that we handle all cases where exceptions are converted to error codes.

Reviewers: David Arthur <mumrah@gmail.com>
2022-08-17 18:11:42 -07:00
Jason Gustafson e5b865d6bf
KAFKA-13940; Return NOT_LEADER_OR_FOLLOWER if DescribeQuorum sent to non-leader (#12517)
Currently the server will return `INVALID_REQUEST` if a `DescribeQuorum` request is sent to a node that is not the current leader. In addition to being inconsistent with all of the other leader APIs in the raft layer, this error is treated as fatal by both the forwarding manager and the admin client. Instead, we should return `NOT_LEADER_OR_FOLLOWER` as we do with the other APIs. This error is retriable and we can rely on the admin client to retry it after seeing this error.

Reviewers: David Jacot <djacot@confluent.io>
2022-08-17 15:48:32 -07:00
Jason Gustafson 0243bb98a7
HOTFIX: Revert KAFKA-10199 which is causing compilation failures (#12532)
Compilation is failing after these two commits:
```
> Task :streams:compileJava
/Users/jgustafson/Projects/kafka/streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java:852: error: cannot find symbol
                        tasks.addPendingTaskToClose(restoringTask.id());
                             ^
  symbol:   method addPendingTaskToClose(org.apache.kafka.streams.processor.TaskId)
  location: variable tasks of type org.apache.kafka.streams.processor.internals.Tasks
1 error
```

Also here:
```

[2022-08-17T20:58:20.912Z] > Task :streams:compileTestJava

[2022-08-17T20:58:20.912Z] /home/jenkins/jenkins-agent/workspace/Kafka_kafka-pr_PR-12530/streams/src/test/java/org/apache/kafka/streams/processor/internals/TaskManagerTest.java:822: error: method setupForRevocation(Set<Task>,Set<Task>) is already defined in class TaskManagerTest

[2022-08-17T20:58:20.912Z]     private TaskManager setupForRevocation(final Set<Task> tasksInStateUpdater,
```
 This patch reverts them.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2022-08-17 14:29:49 -07:00
Bruno Cadonna b47c4d8598
KAFKA-10199: Remove tasks from state updater on revocation (#12520)
Removes tasks from the state updater when the input partitions of the tasks are revoked during a rebalance.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2022-08-17 11:13:34 -07:00
Bruno Cadonna 9f20f89953
KAFKA-10199: Remove tasks from state updater on partition lost (#12521)
Removes tasks from the state updater when the input partitions of the tasks are lost during a rebalance.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2022-08-17 11:12:30 -07:00
Janik Dotzel ae3f48b699
MINOR: Fix invalid link to plugin.path property docs in quickstart (#12523)
Reviewers: Chris Egerton <fearthecellos@gmail.com>
2022-08-17 13:25:35 -04:00
Kvicii d8e93c368d
KAFKA-13971:Atomicity violations caused by improper usage of ConcurrentHashMap (#12277)
Reviewers: Divij Vaidya <diviv@amazon.com>, Chris Egerton <fearthecellos@gmail.com>
2022-08-17 12:32:24 -04:00
K8sCat ad96406e9b
KAFKA-14148: Update ResetOffsetsDoc (#12491)
Reviewers: David Jacot <djacot@confluent.io>
2022-08-16 15:40:24 +02:00
Guozhang Wang dc72f6ec02
KAFKA-10199: Handle task closure and recycling from state updater (#12466)
1. Within the tryCompleteRestore function of the thread, try to drain the removed tasks from state updater and handle accordingly: 1) for recycle, 2) for closure, 3) for update input partitions.
2. Catch up on some unit test coverage from previous PRs.
3. Some minor cleanups around exception handling.

Reviewers: Bruno Cadonna <cadonna@apache.org>
2022-08-15 19:33:46 -07:00
Ismael Juma 597130c016
MINOR: Improve readability of `tryProcessAlterPartition` (#12515)
After 520f72995d, the subsequent checks are ensuring that
the leader and partition epochs are not less than. So,
make that explicit.

Reviewers: Jason Gustafson <jason@confluent.io>
2022-08-15 15:54:13 -07:00
Yash Mayya 18142bff4b
KAFKA-13809: Propagate full connector configuration to tasks in FileStream connectors (#12450)
Reviewers: Chris Egerton <fearthecellos@gmail.com>
2022-08-15 15:25:29 -04:00
Jason Gustafson 5990471b8c
KAFKA-14154; Kraft controller should return NOT_CONTROLLER if request epoch is ahead (#12514)
Similar to https://github.com/apache/kafka/pull/12506. For the Kraft controller, we should return NOT_CONTROLLER if the leader/partition epoch in the request is ahead of the controller. 

Reviewers: José Armando García Sancio <jsancio@users.noreply.github.com>
2022-08-15 11:34:29 -07:00
Bruno Cadonna 75d89931e0
MINOR: Add setting input partitions for task mocks (#12510)
We recently added a builder to create task mocks for unit
tests. This PR adds the functionality to add input partitions
to task mocks when the builder is used.

Reviewers: Walker Carlson <wcarlson@confluent.io>, A. Sophie Blee-Goldman <ableegoldman@apache.org>
2022-08-15 11:16:32 -07:00
Chia-Ping Tsai 3154714548
MINOR: Appending value to LIST config should not generate empty string with … (#12503)
Reviewers: dengziming <dengziming1993@gmail.com>, Luke Chen <showuon@gmail.com>
2022-08-16 02:05:28 +08:00
Badai Aqrandista d529d86aa4
KAFKA-13559: Fix issue where responses intermittently takes 300+ ms to respond, even when the server is idle. (#12416)
Ensures that SSL buffered data is processed by server immediately on the next poll when channel is unmuted after processing previous request. Poll timeout is reset to zero for this case to avoid 300ms delay in poll() if no new data arrives on the sockets.

Reviewers: David Mao <dmao@confluent.io>, Ismael Juma <ismael@juma.me.uk>, Rajini Sivaram <rajinisivaram@googlemail.com>
2022-08-15 12:34:03 +01:00
Ismael Juma 91c23a3b93
MINOR: Cleanup NetworkReceive constructors (#12511)
There was unnecessary duplication and one of the overloads
did not set the size field for no good reason.

Reviewers: Luke Chen <showuon@gmail.com>
2022-08-14 12:54:20 -07:00
Francesco Nigro aecd47b3bc
KAFKA-13900 Support Java 9 direct ByteBuffer Checksum methods (#12163)
Some numbers with JDK 11.

Before:
```
Benchmark                 (bytes)  (direct)  (readonly)  (seed)   Mode  Cnt   Score    Error   Units
Crc32CBenchmark.checksum      128     false       false      42  thrpt   20  26.730 ±  0.410  ops/us
Crc32CBenchmark.checksum      128      true       false      42  thrpt   20   1.781 ±  0.007  ops/us
Crc32CBenchmark.checksum     1024     false       false      42  thrpt   20   6.553 ±  0.053  ops/us
Crc32CBenchmark.checksum     1024      true       false      42  thrpt   20   0.223 ±  0.001  ops/us
Crc32CBenchmark.checksum     4096     false       false      42  thrpt   20   4.054 ±  0.015  ops/us
Crc32CBenchmark.checksum     4096      true       false      42  thrpt   20   0.056 ±  0.001  ops/us
```

And this PR:
```
Benchmark                 (bytes)  (direct)  (readonly)  (seed)   Mode  Cnt   Score   Error   Units
Crc32CBenchmark.checksum      128     false       false      42  thrpt   20  26.922 ± 0.065  ops/us
Crc32CBenchmark.checksum      128      true       false      42  thrpt   20  24.656 ± 0.620  ops/us
Crc32CBenchmark.checksum     1024     false       false      42  thrpt   20   6.548 ± 0.025  ops/us
Crc32CBenchmark.checksum     1024      true       false      42  thrpt   20   6.432 ± 0.136  ops/us
Crc32CBenchmark.checksum     4096     false       false      42  thrpt   20   4.031 ± 0.022  ops/us
Crc32CBenchmark.checksum     4096      true       false      42  thrpt   20   4.004 ± 0.016  ops/us
```

The purpose of the PR is to makes heap and direct ByteBuffer able to perform the same (especially
not read-only), without affecting the existing heap ByteBuffer performance.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Divij Vaidya <diviv@amazon.com>
2022-08-12 20:09:15 -07:00