Commit Graph

13574 Commits

Author SHA1 Message Date
TengYao Chi 4a485ddb71
KAFKA-17315 Fix the behavior of delegation tokens that expire immediately upon creation in KRaft mode (#16858)
In kraft mode, expiring delegation token (`expiryTimePeriodMs` < 0) has following different behavior to zk mode.

1. `ExpiryTimestampMs` is set to "expiryTimePeriodMs" [0] rather than "now" [1]
2. it throws exception directly if the token is expired already [2]. By contrast, zk mode does not. [3]

[0] 49fc14f611/metadata/src/main/java/org/apache/kafka/controller/DelegationTokenControlManager.java (L316)
[1] 49fc14f611/core/src/main/scala/kafka/server/DelegationTokenManagerZk.scala (L292)
[2] 49fc14f611/metadata/src/main/java/org/apache/kafka/controller/DelegationTokenControlManager.java (L305)
[3] 49fc14f611/core/src/main/scala/kafka/server/DelegationTokenManagerZk.scala (L293)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-25 07:29:58 +08:00
xijiu e750f44cf8
KAFKA-17409 Remove deprecated constructor of org.apache.kafka.clients.producer.RecordMetadata (#16979)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-25 06:02:42 +08:00
Greg Harris ad0d8b6c12
MINOR: Clean should delete generated sources (#16839)
Reviewers: Josep Prat <josep.prat@aiven.io>, Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>
2024-08-24 17:16:33 -04:00
David Arthur 0123bdcf06
MINOR: Fix GH Gradle caching (#16975)
In order for Gradle to restore the cache, it needs to use the same workflow ID. This PR consolidates trunk and PRs builds to both use the CI build.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-24 01:47:09 +08:00
David Arthur be3e674e78
MINOR: Add JUnit parser for GH Actions (#16966)
A few improvements for JUnit in the Actions workflow:

* Generate a human readable job summary of the tests 
* Fail the workflow if JUnit tests fail
* Archive the HTML JUnit reports

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-23 10:09:59 -04:00
Jeff Kim ced34e3176
KAFKA-16379; Coordinator event queue, processing, flush, purgatory time histograms (#16949)
This patch introduces a wrapper around [HdrHistogram](https://github.com/HdrHistogram/HdrHistogram) to use for group coordinator histograms, event queue time, event processing time, flush time, and purgatory time.

Reviewers: David Jacot <djacot@confluent.io>
2024-08-23 04:53:22 -07:00
Andrew Schofield ffc865c432
KAFKA-17291: Add integration test for share group list and describe (#16920)
Add an integration test for share group list and describe admin operations.

Reviewers: Omnia Ibrahim <o.g.h.ibrahim@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>
2024-08-23 16:31:04 +05:30
Mickael Maison eafb92bdce
KAFKA-17193: Pin all external GitHub Actions to the specific git hash (#16960)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-23 12:37:12 +02:00
Ao Li a85f0a89c8
KAFKA-17112: Manually stop task manager if stream thread is not in CREATED state (#16625)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 20:37:25 -07:00
Murali Basani 8ceb05d203
KAFKA-16329: Remove deprecated IQ metadata classes in Kafka Streams (#16762)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 20:18:30 -07:00
Jim Galasyn 39555bec0f
MINOR: Add anchor to Kafka Streams page for use cases (#11568)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 19:32:54 -07:00
Ayoub Omari 38eed50e9a
MINOR: Kafka Streams JavaDoc fixes (#15694)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 19:15:17 -07:00
Caio Guedes c7f0ade7e0
KAFKA-16334: Remove --bootstrap-servers from kafka-streams-application-reset
Reviewers: Matthias J. Sax <matthias@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-22 18:55:25 -07:00
TengYao Chi 46597638ee
KAFKA-17371: Fix DefaultTaskExecutorTest.shouldUnassignTaskWhenRequired (#16941)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 18:44:58 -07:00
TengYao Chi 79f979cd52
KAFKA-17372 Move `ThrottledChannelExpirationTest#testThrottledChannelDelay` and `ThrottledChannel` to server module (#16935)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-23 05:09:57 +08:00
Murali Basani a2f89f5412
KAFKA-16333: remove deprecated join method with named param (#16764)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2024-08-22 13:20:56 -07:00
Ken Huang a3aa6372ea
KAFKA-17336 Add IT to make sure the production MV does not use unstable version of LIST_OFFSET (#16893)
- due to the server config UNSTABLE_API_VERSIONS_ENABLE_CONFIG is true, so we can't test the scenario of ListOffsetsRequest is unstable version. We want to test this case in this PR
- get the MV from metadataCache.metadataVersion() instead of config.interBrokerProtocolVersion since MV can be set dynamically.

Reviewers: Jun Rao <junrao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-23 03:47:55 +08:00
xijiu 246b165456
KAFKA-17359 Add tests and enhance the docs of `Admin#describeConfigs` for the case of nonexistent resource (#16947)
- The different behavior of nonexistent resource. For example: nonexistent broker will cause timeout; nonexistent topic will produce UnknownTopicOrPartitionException; nonexistent group will return static/default configs; client_metrics will return empty configs
- The resources (topic and broker resource types are currently supported) this description is out-of-date
- Add some junit test

Reviewers: Andrew Schofield <aschofield@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-23 03:23:34 +08:00
Ken Huang 61a661ec5e
MINOR: Speed up JoinGroupRequestTest, ListGroupsRequestTest, SyncGroupRequestTest by decreased rebalance deplay from 3s to 1s (#16810)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-22 16:03:55 +08:00
Dmitry Werner 6cad2c0d67
KAFKA-17370 Move LeaderAndIsr to metadata module (#16943)
isrWithBrokerEpoch = addBrokerEpochToIsr(isrToSend.toL
2024-08-22 15:47:09 +08:00
Matthias J. Sax 0300025097
MINOR: fix HTML for topology.optimization config (#16953)
The HTML rendering broke via https://issues.apache.org/jira/browse/KAFKA-14209 in 3.4 release. The currently shown value is some garbage org.apache.kafka.streams.StreamsConfig$$Lambda$20/0x0000000800c0cf18@b1bc7ed

cf https://kafka.apache.org/documentation/#streamsconfigs_topology.optimization

Verified the fix via running StreamsConfig#main() locally.

Reviewers: Bill Bejeck <bill@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-22 15:24:16 +08:00
PoAn Yang 28cd7136fb
KAFKA-16324 Move BrokerApiVersionsCommand to tools (#16850)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-22 09:22:20 +08:00
David Arthur 95ef75aa48
MINOR: Github build enable Gradle cache and add checkstyle annotations (#16948)
This patch allows the gradle cache to be used on GitHub Actions. 

Also adds a Python script to parse checkstyle reports and produce GitHub annotations on PRs.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-21 19:33:37 -04:00
Andrew Schofield 94f5039350
KAFKA-17378 Fixes for performance testing (#16942)
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-22 06:53:21 +08:00
Matthias J. Sax 1e14b0c964
MINOR: Cleanup Joined class (#14551)
Code cleanup and JavaDocs fixed, plus add missing getters to JoinedInternal.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-08-21 14:31:22 -07:00
Matthias J. Sax e4cc5d18f4
MINOR: remove get prefix for internal Kafka Streams methods (#16722)
Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-08-21 14:27:14 -07:00
Matthias J. Sax 9d81a67009
MINOR: update flaky KafkaStreamsTest (#16756)
testStateGlobalThreadClose() does fail sometimes, with unclear root
cause. This PR is an attempt to fix it, by cleaning up and improving the
test code across the board.

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
2024-08-21 14:23:27 -07:00
Alyssa Huang 0bb2aee838
KAFKA-17305; Check broker registrations for missing features (#16848)
When a broker tries to register with the controller quorum, its registration should be rejected if it doesn't support a feature that is currently enabled. (A feature is enabled if it is set to a non-zero feature level.) This is important for the newly added kraft.version feature flag.

Reviewers: Colin P. McCabe <cmccabe@apache.org>, José Armando García Sancio <jsancio@apache.org>
2024-08-21 11:14:56 -07:00
David Jacot 7c7751d8da
KAFKA-14048; [1/N] Use the new group coordinator by default in 4.0 (#16937)
This patch prepares the ground to switch on the new group coordinator by default. It basically ensures that the integration tests uses the internal flag to enable/disable the new group coordinator instead of relying on the auto-enabling that we had in place for the early access and the preview. The auto-enabling will be removed in a follow-up PR.

Reviewers: Jeff Kim <jeff.kim@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-21 05:49:49 -07:00
PoAn Yang 0eaaff88cf
KAFKA-17151 Remove waitForCondition when detecting thread leak (#16661)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-21 17:09:31 +08:00
David Jacot 944c1353a9
KAFKA-16736 Remove `offsets.commit.required.acks` in 4.0 (#16938)
Reviewers: Jeff Kim <jeff.kim@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-21 11:14:04 +08:00
José Armando García Sancio 7b6d4fbc57
KAFKA-17333; ResignedState should not notify of leader change (#16900)
When a voter fails as leader (LeaderState) the quorum-state still states that it is the leader of
the epoch. When the voter starts it never starts as leader and instead starts as resigned
(ResignedState) if it was previously a leader. This causes the KRaft client to immediately notify
the state machine (e.g QuorumController) that it is leader or active. This is incorrect for two
reasons.

One, the controller cannot be notified of leadership until it has reached the LEO. If the
controller is notified before that it will generate and append records that are not based on the
latest state.

Two, it is not practical to notify of local leadership when it is resigned since any write
operation (prepareAppend and schedulePreparedAppend) will fail with NotLeaderException while KRaft
is in the resigned state.

Reviewers: Colin P. McCabe <cmccabe@apache.org>, David Arthur <mumrah@gmail.com>
2024-08-20 16:24:13 -07:00
David Arthur 7095280495
MINOR: Separate GH workflows for PRs and trunk (#16936)
This patch creates separate GitHub Actions workflows for trunk and for pull requests.

On trunk, each commit will be built separately and the build scan will be uploaded to ge.apache.org. The trunk builds will also populate a Gradle cache managed by Github Actions.

Pull Requests will be built on each commit, but will interrupt an ongoing build (for the same PR). These builds will not populate the Gradle cache and will not upload the build scan unless the PRs are in apache/kafka.

For now, only pull requests with branches named like "gh-*" will run the junit tests. This is to allow developers to opt-in to the GH build.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 18:39:42 -04:00
Mason Chen fb7e47f6e2
KAFKA-17169: Add EndpointsTest (#16659)
Reviewers: Omnia Ibrahim <o.g.h.ibrahim@gmail.com>, Colin P. McCabe <cmccabe@apache.org>
2024-08-20 15:08:28 -07:00
Xuan-Zhang Gong a537e716eb
KAFKA-17137 Ensure Admin APIs are properly tested (#16658)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-21 03:34:10 +08:00
Mickael Maison e23172a48a
MINOR: Move OffsetCheckpointFile to storage module (#16917)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 16:29:24 +02:00
Sean Quah c207438823
KAFKA-17279: Handle retriable errors from offset fetches (#16826)
Handle retriable errors from offset fetches in ConsumerCoordinator.

Reviewers: Lianet Magrans <lianetmr@gmail.com>, David Jacot <djacot@confluent.io>
2024-08-20 06:13:25 -07:00
David Jacot de67ac6a9a
MINOR: Update `getOrMaybeCreateClassicGroup` to only throw GroupIdNotFoundException (#35) (#16919)
This patch updates getOrMaybeCreateClassicGroup to only throw GroupIdNotFoundException as we did for other internal methods. The callers are responsible for translating the error to the appropriate one depending on the context. There is only one case.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 04:36:42 -07:00
ShivsundarR 932e84096a
KAFKA-17325: Updated result handling in ShareConsumeRequestManager::commitAsync(). (#16903)
Currently we were not updating the result count when we merged commitAsync() requests into one batch in ShareConsumeRequestManager, so this led to lesser acknowledgements sent to the application thread (ShareConsumerImpl) than expected.
Fix : Now if the acknowledge response came from a commitAsync, then we do not wait for other requests to complete, we always prepare a background event to be sent.

This PR also fixes a bug in ShareConsumeRequestManager, where during the final ShareAcknowledge sent during close(), we also pick up any piggybacked acknowledgements which were waiting to be sent along with ShareFetch.

 Reviewers:  Andrew Schofield <aschofield@confluent.io>,  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-08-20 16:44:53 +05:30
Andrew Schofield f6bfa9406c
KAFKA-17350: Improve share group describe for empty groups (#16897)
When you use kafka-share-groups.sh --describe for an empty group, it prints an empty table consisting of only the table header. kafka-consumer-groups.sh summarises the group status to make the output more informative and only prints the table if it contains more than zero rows.

This PR applies this principle across all of the variants of describing share groups which makes the output much nicer where the output would otherwise be strangely empty.

Reviewers:  Manikumar Reddy <manikumar.reddy@gmail.com>
2024-08-20 12:05:08 +05:30
Kuan-Po Tseng 4271565409
KAFKA-16900 kafka-producer-perf-test reports error when using transaction. (#16646)
Currently, users need to set --transaction-duration-ms to enable transactions in kafka-producer-perf-test, which is not straightforward. A better approach is to enable transactions when a transaction ID is provided.

This PR allows enabling transaction in kafka-producer-perf-test by either

- set transaction.id=<id> via --producer-props or
- set transaction.id=<id> in config file via --producer.config or
- set --transaction-id <id> or
- set --transaction-duration-ms=<ms>

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 10:23:55 +08:00
David Arthur 4e1a015d36
MINOR: Remove 11 and 17 from GH workflow (#16927)
This patch removes Java versions 11 and 17 from the "check" job. This patch also fixes the develocity build scan upload.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-19 21:59:36 -04:00
Chung, Ming-Yen 65786fecbf
KAFKA-17181 Replace fileChannel.write with Utils.writeFully to prevent partial write (#16707)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 09:26:43 +08:00
TengYao Chi c3d552d273
KAFKA-12824 Remove Deprecated method KStream#branch (#16803)
The method branch in both Java and Scala KStream class was deprecated in version 2.8:

1) org.apache.kafka.streams.scala.kstream.KStream#branch
2) org.apache.kafka.streams.kstream.KStream#branch(org.apache.kafka.streams.kstream.Predicate<? super K,? super V>...)
3) org.apache.kafka.streams.kstream.KStream#branch(org.apache.kafka.streams.kstream.Named, org.apache.kafka.streams.kstream.Predicate<? super K,? super V>...)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 09:05:13 +08:00
José Armando García Sancio ee71156295
KAFKA-17332; Controller always flush and can call resign on observers (#16907)
This change includes two improvements.

When the leader removes itself from the voters set clients of RaftClient may call resign. In those cases the leader is not in the voter set and should not throw an exception.

Controllers that are observers must flush the log on every append because leader may be trying to add them to the voter set. Leader always assume that voters flush their disk before sending a Fetch request.

Reviewers: David Arthur <mumrah@gmail.com>, Alyssa Huang <ahuang@confluent.io>
2024-08-19 20:44:23 -04:00
David Schlosnagle 050edfaf00
KAFKA-14336: MetadataResponse#convertToNodeArray uses iteration (#12782)
Avoids stream allocation on hot code path in Admin#listOffsets

This patch avoids allocating the stream reference pipeline & spliterator for this case by explicitly allocating the pre-sized Node[] and using a for loop with int induction over the specified IDs List argument.

Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>, Kirk True <kirk@kirktrue.pro>, David Arthur <mumrah@gmail.com>
2024-08-19 19:46:51 -04:00
Greg Harris b40b5a24f4
KAFKA-17369: Remove Reflections from logging and update licenses (#16924)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-08-19 16:27:36 -07:00
PoAn Yang d0cd3a899a
KAFKA-17180 Upgrade gradle from 8.8 to 8.10 (#16908)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 06:37:59 +08:00
Andrew Schofield 34475070e1
KAFKA-17368 Add delivery count to kafka-console-share-consumer.sh (#16925)
Now that ConsumerRecord.deliveryCount() exists, enhance kafka-console-share-consumer.sh to exploit it. Added support to the DefaultMessageFormatter and the option print.delivery to the usage message for kafka-console-share-consumer.sh. Note that it was not added to kafka-console-consumer.sh even though the option would be recognised - this is because delivery with a consumer group does not count deliveries, and the result would include Delivery:NOT_PRESENT for all records if it was enabled - not really that useful with a consumer group.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-20 06:19:36 +08:00
David Arthur 3d868aacf2
MINOR add GH action for PR builds (#16895)
For now this will only run on PRs with branch names starting with "gh-"

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-19 16:46:20 -04:00