Commit Graph

8337 Commits

Author SHA1 Message Date
Matthias J. Sax e3b0ea81ca
MINOR: add missing quickstart.html file (#9722)
Reviewers: Guozhang Wang <guozhang@confluent.io>, Bill Bejeck <bill@confluent.io>
2020-12-22 16:45:50 -08:00
Matthias J. Sax bb813310c7
MINOR: remove dangling quickstart-*.html (#9721)
Reviewers: Guozhang Wang <guozhang@confluent.io>
2020-12-22 16:19:43 -08:00
Bill Bejeck b6891f6729
MINOR: Kafka Streams updates for 2.7.0 release (#9773)
Reviewer: Matthias J. Sax <matthias@confluent.io>
2020-12-22 14:34:59 -08:00
vamossagar12 d5151f6f09
KAFKA-10828; Replacing endorsing with acknowledging for voters (#9737)
This PR replaces the terms endorsing with acknowledging for voters which have recognised the current leader.

Reviewers: Jason Gustafson <jason@confluent.io>
2020-12-22 10:05:07 -08:00
Jason Gustafson eb9fe411bb
KAFKA-10842; Use `InterBrokerSendThread` for raft's outbound network channel (#9732)
This patch contains the following improvements:

- Separate inbound/outbound request flows so that we can open the door for concurrent inbound request handling
- Rewrite `KafkaNetworkChannel` to use `InterBrokerSendThread` which fixes a number of bugs/shortcomings
- Get rid of a lot of boilerplate conversions in `KafkaNetworkChannel` 
- Improve validation of inbound responses in `KafkaRaftClient` by checking correlationId. This fixes a bug which could cause an out of order Fetch to be applied incorrectly.

Reviewers: David Arthur <mumrah@gmail.com>
2020-12-21 18:15:15 -08:00
David Arthur d3f19e4bb0
KAFKA-10825 ZooKeeper ISR manager (#9713)
ISR-related cleanup in ReplicaManager and Partition. Removes ISR change logic from ReplicaManager and adds a new ZkIsrManager class which adheres to a new AlterIsrManager trait. Unifies all of the ISR logic in Partition so we don't have separate code paths for ZK vs AlterIsr. Also removes PartitionStateStore
2020-12-21 14:44:02 -05: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
APaMio 1670362236
MINOR: Replace Collection.toArray(new T[size]) by Collection.toArray(new T[0]) (#9750)
This PR is based on the research of https://shipilev.net/blog/2016/arrays-wisdom-ancients

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-21 17:38:33 +08:00
Chia-Ping Tsai 4e7c789118
MINOR: refactor SelectingIterator by scala iterator (#9755)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-12-21 16:11:51 +08:00
Chia-Ping Tsai 87260a33b0
HOTFIX: fix failed ControllerChannelManagerTest#testUpdateMetadataRequestSent (#9768)
Reviewers: David Jacot <djacot@confluent.io>
2020-12-21 12:29:10 +08:00
Justine Olshan 1dd1e7f945
KAFKA-10545: Create topic IDs and propagate to brokers (#9626)
This change propagates topic ids to brokers in LeaderAndIsr Request. It also removes the topic name from the LeaderAndIsr Response, reorganizes the response to be sorted by topic, and includes the topic ID.

In addition, the topic ID is persisted to each replica in Log as well as in a file on disk. This file is read on startup and if the topic ID exists, it will be reloaded.

Reviewers: David Jacot <djacot@confluent.io>, dengziming <dengziming1993@gmail.com>, Nikhil Bhatia <rite2nikhil@gmail.com>, Rajini Sivaram <rajinisivaram@googlemail.com>
2020-12-18 22:19:50 +00:00
dengziming 5c921afa4a
KAFKA-10547; Add TopicId in MetadataResponse (#9622)
Includes:
- Bump the version of MetadataRequest and MetadataResponse, add topicId in MetadataResponse
- Alter describeTopic in AdminClientTopicService and ZookeeperTopicService
- TopicMetadata is cached in MetadataCache, so we need to add topicId to MetadataCache
- MetadataCache is updated by UpdateMetadataRequest, bump the version of UpdateMetadataReq and UpdateMetadataResp, add topicId in UpdateMetadataReq.

Reviewers: Justine Olshan <jolshan@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2020-12-18 21:30:52 +00:00
Scott Hendricks baef516789
Add ConfigurableProducerSpec to Trogdor for improved E2E latency tracking. (#9736)
Reviewer: Colin P. McCabe <cmccabe@apache.org>
2020-12-18 13:03:59 -08:00
Cheng Tan ae3a6ed990
KAKFA-10619: Idempotent producer will get authorized once it has a WRITE access to at least one topic (KIP-679) (#9485)
Includes:
- New API to authorize by resource type
- Default implementation for the method that supports super users and ACLs
- Optimized implementation in AclAuthorizer that supports ACLs, super users and allow.everyone.if.no.acl.found
- Benchmarks and tests
- InitProducerIdRequest authorized for Cluster:IdempotentWrite or WRITE to any topic, ProduceRequest authorized only for topic even if idempotent

Reviewers: Lucas Bradstreet <lucas@confluent.io>, Rajini Sivaram <rajinisivaram@googlemail.com>
2020-12-18 18:08:46 +00:00
Tom Bentley 67150b815e
KAFKA-10846: Grow buffer in FileSourceStreamTask only when needed (#9735)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-18 12:01:38 +08:00
Matthias J. Sax b689507c41
MINOR: fix error message (#9730)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2020-12-17 17:09:45 -08:00
Govinda Sakhare f8b26563e1
KAFKA-10850: Use primitive type to replace deprecated 'new Integer' from BrokerToControllerRequestThreadTest (#9760)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-18 00:43:21 +08:00
David Jacot 02a30a51eb
KAFKA-10740; Replace OffsetsForLeaderEpochRequest.PartitionData with automated protocol (#9689)
This patch follows up https://github.com/apache/kafka/pull/9547. It refactors AbstractFetcherThread and its descendants to use `OffsetForLeaderEpochRequestData.OffsetForLeaderPartition` instead of `OffsetsForLeaderEpochRequest.PartitionData`. The patch relies on existing tests.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Jason Gustafson <jason@confluent.io>
2020-12-17 17:40:37 +01:00
Jason Gustafson 4089c36b33
KAFKA-10861; Fix race condition in flaky test `testFencingOnSendOffsets` (#9762)
I wasn't able to reproduce the failure locally, but it looks like there is a race condition with the sending of the records in the first producer. The test case assumes that these records have been completed before the call to `sendOffsetsToTransaction`, but they very well might not be. It is even possible for the writes from the second producer to arrive first which would then result in the test failure that we are seeing. The solution is to force the send with `flush()`.

Reviewers: Guozhang Wang <guozhang@apache.org>, Boyang Chen <boyang@confluent.io>
2020-12-16 18:31:15 -08:00
leah f4272fd5d3
KAFKA-9126: KIP-689: StreamJoined changelog configuration (#9708)
Add withLoggingEnabled and withLoggingDisabled for StreamJoined
to give StreamJoined the same flexibility as Materialized

Reviewers: Bruno Cadonna <bruno@confluent.io>, John Roesler <vvcephei@apache.org>
2020-12-16 16:19:33 -06:00
Ismael Juma 782175dfbc
MINOR: Simplify ApiKeys by relying on ApiMessageType (#9748)
* The naming for `ListOffsets` was inconsistent, in some places it was `ListOffset` and in others
it was `ListOffsets`. Picked the latter since it was used in metrics and the protocol documentation
and made it consistent.
* Removed unused methods in ApiKeys.
* Deleted `CommonFields`.
* Added `lowestSupportedVersion` and `highestSupportedVersion` to `ApiMessageType`
* Removed tests in `MessageTest` that are no longer relevant.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-16 06:33:10 -08:00
Tom Bentley ad4211fad7
HOTFIX: Access apiversions data via method not field (#9759)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-16 22:22:08 +08:00
Tom Bentley 6116605179
KAFKA-10656: Log the feature flags received by the client (#9552)
print out the feature flags received at DEBUG level, as well as the other version information.

Example log line:
[2020-11-03 17:47:17,076] DEBUG Node 0 has finalizedFeaturesEpoch: 42, finalizedFeatures: [FinalizedFeatureKey(name='feature_1', maxVersionLevel=2, minVersionLevel=1), FinalizedFeatureKey(name='feature_2', maxVersionLevel=4, minVersionLevel=3)], supportedFeatures: [SupportedFeatureKey(name='feature_1', minVersion=1, maxVersion=2), SupportedFeatureKey(name='feature_2', minVersion=3, maxVersion=4)] (org.apache.kafka.clients.NetworkClient:926)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-16 21:50:15 +08:00
Chia-Ping Tsai d84a82c32d
MINOR: make Send and Receive work with TransferableChannel rather than Gat… (#9516)
This PR introduces a new interface 'TransferableChannel' to replace GatheringByteChannel to avoid casting in write path. `TransferableChannel ` extends GatheringByteChannel with the minimal set of methods required by the Send interface. Supporting TLS and efficient zero copy transfers are the main reasons for the additional methods.

Co-authored-by: Ismael Juma <ismael@juma.me.uk>

Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-12-16 08:51:40 +08: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
Jason Gustafson a084dd829c
MINOR: Fix bad logging substitution in `AbstractCoordinator` (#9757)
Missed this in #9729. The substitution in `markCoordinatorUnknown` does not work because the argument is not provided as a parameter.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-12-15 15:51:37 -08:00
Lucas Bradstreet ea8ae97650
KAFKA-10839; improve consumer group coordinator unavailable message (#9729)
When a consumer encounters an issue that triggers marking it to mark coordinator as unknown, the error message it prints does not give much context about the error that triggered it. This change includes the response error that triggered the transition or any other cause if not triggered by an error code in a response.

Reviewers: Jason Gustafson <jason@confluent.io>
2020-12-15 14:38:18 -08:00
Jason Gustafson d072be6d90
KAFKA-10855; Fix non-local return in `KafkaApis.handle` (#9753)
The non-local return when `maybeHandleInvalidEnvelope` returns true causes the default error handler to execute after a response has already been sent. This patch rewrites the check as a local return.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-15 13:07:48 -08:00
leah 793117d455
KAFKA-10417: Update Cogrouped processor to work with suppress() and joins (#9727)
Correct the implementation of the Cogroup
processor to implement KTableProcessorSupplier.

Change the cogrouped processor from PassThrough to
KTablePassThrough to allow for sending old values.
KTablePassThrough extends KTableProcessorSupplier instead of
ProcessorSupplier to implement sending old values and the view() method.

Reviewers: Walker Carlson <wcarlson@confluent.io>, John Roesler <vvcephei@apache.org>
2020-12-15 14:53:56 -06:00
Viktor Somogyi-Vass 1aac64667f
KAFKA-6084: Propagate JSON parsing errors in ReassignPartitionsCommand (#4090)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-12-15 10:05:40 -08:00
Luke Chen 3717ab0ff2
KAFKA-10776: Add version attribute in RequestsPerSec metrics documentation (#9661)
See https://cwiki.apache.org/confluence/display/KAFKA/KIP-272%3A+Add+API+version+tag+to+broker%27s+RequestsPerSec+metric

Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-12-15 06:39:07 -08:00
Luke Chen a07923c4f2
KAFKA-10854: fix flaky testConnectionRatePerIp test (#9752)
Reviewers: David Jacot <djacot@confluent.io>
2020-12-15 14:54:22 +01:00
Anastasia Vela 1a10c3445e
KAFKA-10525: Emit JSONs with new auto-generated schema (KIP-673) (#9526)
This patch updates the request logger to output request and response payloads in JSON. Payloads are converted to JSON based on their auto-generated schema.

Reviewers:  Lucas Bradstreet <lucas@confluent.io>, David Mao <dmao@confluent.io>, David Jacot <djacot@confluent.io>
2020-12-15 14:33:36 +01:00
Ismael Juma 5e5daf47ef
KAFKA-10852: AlterIsr should not be throttled (#9747)
Set it as a cluster action and update the handler in KafkaApis. We keep the `throttleTimeMs` field
since we intend to enable throttling in the future (especially relevant when we switch to the
built-in quorum mode).

Reviewers: David Arthur <mumrah@gmail.com>
2020-12-14 22:28:47 -08:00
Chia-Ping Tsai 78b74debe4
Revert "MINOR: fix typo in `AbstractIndex.scala` (#9745)" (#9751)
This reverts commit 8577ceae87.
2020-12-15 08:39:58 +08:00
panguncle 8577ceae87
MINOR: fix typo in `AbstractIndex.scala` (#9745)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-14 15:34:10 +08:00
Kowshik Prakasam 4401f52d17
MINOR: Make Log.recordVersion private and other small cleanups (#9731)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-14 15:20:20 +08:00
dengziming 3572049863
MINOR: Skip `Struct` conversion in `FetchRequest.parse` (#9740)
This was missed in 6f27bb0.

Reviewers: Ismael Juma <ismael@juma.me.uk>
2020-12-13 08:36:37 -08:00
Kowshik Prakasam cdf725828b
KAFKA-10832: Fix Log to use the correct ProducerStateManager instance when updating producers (#9718)
Reviewers: Ismael Juma <ismael@juma.me.uk>, Jun Rao <junrao@gmail.com>
2020-12-11 16:34:46 -08:00
Walker Carlson d5dc7dfe00
KAFKA-10810: Replace stream threads (#9697)
StreamThreads can now be replaced in the streams uncaught exception handler

Reviewers: Bruno Cadonna <bruno@confluent.io>, John Roesler <vvcephei@apache.org>, Leah Thomas <lthomas@confluent.io>
2020-12-11 15:08:21 -06: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
Matthias J. Sax 567a2ec737
KAFKA-10017: fix flaky EOS-beta upgrade test (#9688)
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2020-12-10 17:32:30 -08:00
dengziming 125d5ea0fb
KAFKA-10677; Complete fetches in purgatory immediately after resigning (#9639)
This patch adds logic to complete fetches immediately after resigning by returning the BROKER_NOT_AVAILABLE error. This ensures that the new election cannot be delayed by fetches which are stuck in purgatory. 

Reviewers: Jason Gustafson <jason@confluent.io>
2020-12-10 09:25:04 -08:00
David Mao b44d32dffe
KAFKA-10748: Add IP connection rate throttling metric (KIP-612) (#9685)
This PR adds the IP throttling metric as described in KIP-612.

Reviewers: Anna Povzner <anna@confluent.io>, David Jacot <djacot@confluent.io>
2020-12-10 12:24:45 +01:00
David Mao 404062d2b6
KAFKA-10747: Extend DescribeClientQuotas and AlterClientQuotas APIs to support IP connection rate quota (KIP-612) (#9628)
This PR adds support for IP entities to the `DescribeClientQuotas` and `AlterClientQuotas` APIs. This PR also adds support for describing/altering IP quotas via `kafka-configs` tooling.

Reviewers: Brian Byrne <bbyrne@confluent.io>, Anna Povzner <anna@confluent.io>, David Jacot <djacot@confluent.io>
2020-12-10 09:53:32 +01:00
Boyang Chen 310e240abd
throw corresponding invalid producer epoch (#9700)
As suggested, ensure InvalidProducerEpoch gets caught properly on stream side.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2020-12-09 20:15:43 -08:00
dengziming 8e82eaa711
MINOR: Fix some java docs of ReplicaStateMachine (#8552)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-10 11:14:35 +08:00
bertber db79f86025
MINOR: remove duplicate code from resetByDuration (#9699)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-12-10 11:08:17 +08:00
Brajesh Kumar fa93982d3a
KAFKA-9892; Producer state snapshot should be forced to disk (#9621)
FileChannel.close() does not guarantee modified buffer would be written on the file system. We are changing  it with force() semantics to enforce file buffer and metadata written to filesystem (FileChannel.force(true) updates buffer and metadata).

Reviewers: Jun Rao <junrao@gmail.com>, Jason Gustafson <jason@confluent.io>
2020-12-09 14:13:36 -08:00
Chia-Ping Tsai 6e15937feb
KAFKA-10289; Fix failed connect_distributed_test.py (ConnectDistributedTest.test_bounce) (#9673)
In Python 3, `filter` functions return iterators rather than `list` so it can traverse only once. Hence, the following loop will only see "empty" and then validation fails.

```python
        src_messages = self.source.committed_messages() # return iterator
        sink_messages = self.sink.flushed_messages()) # return iterator
        for task in range(num_tasks):
            # only first task can "see" the result. following tasks see empty result
            src_seqnos = [msg['seqno'] for msg in src_messages if msg['task'] == task]
```

Reference: https://portingguide.readthedocs.io/en/latest/iterators.html#new-behavior-of-map-and-filter.

Reviewers: Jason Gustafson <jason@confluent.io>
2020-12-09 13:38:17 -08:00